From bda3ce020a34210aee16afb96b64637161559c2f Mon Sep 17 00:00:00 2001 From: Micaiah Martin Date: Thu, 5 Oct 2023 13:22:28 -0600 Subject: [PATCH] Add Swift release workflow --- .github/workflows/release-swift.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release-swift.yml b/.github/workflows/release-swift.yml index 3b3e7ac58f..b82b43c1b3 100644 --- a/.github/workflows/release-swift.yml +++ b/.github/workflows/release-swift.yml @@ -16,9 +16,11 @@ on: - Dry Run jobs: - setup: - name: Setup + validate: + name: Validate Branch - Set Version runs-on: ubuntu-22.04 + outputs: + version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 @@ -33,12 +35,19 @@ jobs: exit 1 fi - - name: Check release version + - name: Get version id: version run: | VERSION=$(grep -o '^version = ".*"' crates/bitwarden/Cargo.toml | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+") echo "version=$VERSION" >> $GITHUB_OUTPUT + github-release: + name: GitHub Release + runs-on: ubuntu-22.04 + needs: validate + env: + _PKG_VERSION: ${{ needs.validate.outputs.version }} + steps: - name: Download all Release artifacts uses: bitwarden/gh-actions/download-artifacts@62d1bf7c3e31c458cc7236b1e69a475d235cd78f with: @@ -50,13 +59,11 @@ jobs: - name: Create release if: ${{ github.event.inputs.release_type != 'Dry Run' }} uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0 - env: - PKG_VERSION: ${{ steps.version.outputs.version }} with: - artifacts: "packages/BitwardenFFI-${{ env.PKG_VERSION }}.xcframework" + artifacts: "packages/BitwardenFFI-${{ env._PKG_VERSION }}.xcframework" commit: ${{ github.sha }} - tag: BitwardenFFI-v${{ env.PKG_VERSION }} - name: BitwardenFFI v${{ env.PKG_VERSION }} + tag: BitwardenFFI-v${{ env._PKG_VERSION }} + name: BitwardenFFI v${{ env._PKG_VERSION }} body: "" token: ${{ secrets.GITHUB_TOKEN }} draft: true