Skip to content

Commit

Permalink
Deploy workflow: Use less actions to create a release
Browse files Browse the repository at this point in the history
  • Loading branch information
quartje committed May 24, 2024
1 parent f5e3e5f commit ef03cd5
Showing 1 changed file with 8 additions and 67 deletions.
75 changes: 8 additions & 67 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
deployment:
permissions:
packages: write
contents: write
environment: deploy
runs-on: ubuntu-latest

Expand Down Expand Up @@ -81,76 +82,16 @@ jobs:
MAVEN_USERNAME: ${{ secrets.BUILD_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.BUILD_PASSWORD }}

- name: Build Changelog
id: changelog
uses: ardalanamini/auto-changelog@v4
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
default-commit-type: New Features
github-token: ${{ github.token }}
files: |
**/target/*.jar
**/target/*.zip
token: ${{ secrets.GITHUB_TOKEN }}
generate_release_notes: true
if: github.event_name != 'workflow_dispatch'

- name: Create release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: true
release_name: Release ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
body: |
${{ steps.changelog.outputs.changelog }}
env:
GITHUB_TOKEN: ${{ github.token }}
if: github.event_name != 'workflow_dispatch'

- name: Check account-gui zip existence
id: check_file_account_gui
uses: andstor/file-existence-action@v2
with:
files: "/home/runner/work/OpenConext-myconext/OpenConext-myconext/account-gui/target/account-gui-${{ github.ref_name }}.zip"
- name: Upload account-gui zip to github release
if: steps.check_file_account_gui.outputs.files_exists == 'true'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: "/home/runner/work/OpenConext-myconext/OpenConext-myconext/account-gui/target/account-gui-${{ github.ref_name }}.zip"
asset_name: account-gui-${{ github.ref_name }}.zip
asset_content_type: application/zip

- name: Check myconext-gui zip existence
id: check_file_myconext_gui
uses: andstor/file-existence-action@v1
with:
files: "/home/runner/work/OpenConext-myconext/OpenConext-myconext/myconext-gui/target/myconext-gui-${{ github.ref_name }}.zip"
- name: Upload myconext-gui zip to github release
if: steps.check_file_myconext_gui.outputs.files_exists == 'true'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/OpenConext-myconext/OpenConext-myconext/myconext-gui/target/myconext-gui-${{ github.ref_name }}.zip
asset_name: myconext-gui-${{ github.ref_name }}.zip
asset_content_type: application/zip

- name: Check myconext-server jar existence
id: check_file_myconext_server
uses: andstor/file-existence-action@v1
with:
files: "/home/runner/work/OpenConext-myconext/OpenConext-myconext/myconext-server/target/myconext-server-${{ github.ref_name }}.jar"
- name: Upload myconext-server jar to github release
if: steps.check_file_myconext_server.outputs.files_exists == 'true'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/OpenConext-myconext/OpenConext-myconext/myconext-server/target/myconext-server-${{ github.ref_name }}.jar
asset_name: myconext-server-${{ github.ref_name }}.jar
asset_content_type: application/zip

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand Down

0 comments on commit ef03cd5

Please sign in to comment.