From 1f1ead2f30bb15ab7244dfd1ee6c7c55d053b9b0 Mon Sep 17 00:00:00 2001 From: Jan Christophersen Date: Fri, 13 May 2022 09:47:14 +0200 Subject: [PATCH] Update workflow for release --- .github/workflows/release.yml | 38 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fda84d3..45c4cfc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,15 +1,14 @@ name: release - on: workflow_dispatch: inputs: tag: - description: "Which tag to deploy as:" + description: 'Which tag to deploy as:' required: true push: tags: - - "[0-9]+.[0-9]+.[0-9]+" + - '[0-9]+.[0-9]+.[0-9]+' jobs: build-release: @@ -22,14 +21,14 @@ jobs: fail-fast: false matrix: targets: - - os: "ubuntu-20.04" - target: "x86_64-unknown-linux-gnu" + - os: 'ubuntu-20.04' + target: 'x86_64-unknown-linux-gnu' cross: false - - os: "macos-11" - target: "x86_64-apple-darwin" + - os: 'macos-11' + target: 'x86_64-apple-darwin' cross: false - - os: "windows-2019" - target: "x86_64-pc-windows-gnu" + - os: 'windows-2019' + target: 'x86_64-pc-windows-gnu' cross: false steps: @@ -45,13 +44,13 @@ jobs: toolchain: stable override: true target: ${{ matrix.targets.target }} - + - name: Install linux packages if: matrix.targets.os == 'ubuntu-20.04' shell: bash run: | - sudo apt-get install -y libdbus-1-dev - + sudo apt-get update && sudo apt-get install -y libdbus-1-dev + - uses: Swatinem/rust-cache@v1 with: key: ${{ matrix.targets.target }} @@ -70,7 +69,7 @@ jobs: cp target/${{ matrix.targets.target }}/release/saml2aws-auto.exe saml2aws-auto.exe 7z a saml2aws-auto-${{ matrix.targets.target }}.zip "saml2aws-auto.exe" echo "ASSET=saml2aws-auto-${{ matrix.targets.target }}.zip" >> $GITHUB_ENV - + - name: Bundle release (Linux and macOS) if: matrix.targets.os != 'windows-2019' shell: bash @@ -78,26 +77,25 @@ jobs: cp target/${{ matrix.targets.target }}/release/saml2aws-auto ./saml2aws-auto zip saml2aws-auto-${{ matrix.targets.target }}${{ matrix.targets.suffix }}.zip saml2aws-auto echo "ASSET=saml2aws-auto-${{ matrix.targets.target }}${{ matrix.targets.suffix }}.zip" >> $GITHUB_ENV - + - name: Create release directory for artifact, move file shell: bash run: | mkdir release mv ${{ env.ASSET }} release/ - + - name: Save release as artifact uses: actions/upload-artifact@v2 with: retention-days: 3 name: release path: release - + upload-release: name: upload-release runs-on: ubuntu-latest needs: [build-release] steps: - - name: Get the release version from the tag if: env.VERSION == '' run: | @@ -107,11 +105,11 @@ jobs: else echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV fi - + - name: Validate release version run: | echo "Release version: ${{ env.VERSION }}" - + - name: Get release artifacts uses: actions/download-artifact@v2 with: @@ -122,7 +120,7 @@ jobs: run: | echo "Generated $(ls ./release | wc -l) files:" ls ./release - + - name: Upload all saved release files uses: softprops/action-gh-release@v1 with: