Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
phavekes committed Jun 21, 2024
1 parent 223b10b commit 743b711
Showing 1 changed file with 11 additions and 68 deletions.
79 changes: 11 additions & 68 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 @@ -41,7 +42,7 @@ jobs:
run: echo "version=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_OUTPUT
id: versioncheck

- name: Exit when workflow_dispatch is triggered, and the version does not contain SNAPSHOT in it's name
- name: Exit when workflow_dispatch is triggered, and the version does not contain SNAPSHOT in its name
run: |
echo "Only SNAPSHOT releases can be triggered with the workflow_dispatch"
exit 1
Expand Down Expand Up @@ -81,74 +82,16 @@ jobs:
MAVEN_USERNAME: ${{ secrets.BUILD_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.BUILD_PASSWORD }}

- name: Build Changelog
id: changelog
uses: ardalanamini/auto-changelog@v3
- name: Release
uses: softprops/action-gh-release@v2
with:
default-commit-type: New Features
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
files: |
/home/runner/work/OpenConext-myconext/OpenConext-myconext/myconext-server/target/myconext-server-${{ github.ref_name }}.jar
/home/runner/work/OpenConext-myconext/OpenConext-myconext/myconext-gui/target/myconext-gui-${{ github.ref_name }}.zip
/home/runner/work/OpenConext-myconext/OpenConext-myconext/account-gui/target/account-gui-${{ github.ref_name }}.zip
token: ${{ secrets.GITHUB_TOKEN }}
fail_on_unmatched_files: true
generate_release_notes: true

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

0 comments on commit 743b711

Please sign in to comment.