From 3c2094bb04e64d93027cc5954cafedb3fbdc9346 Mon Sep 17 00:00:00 2001 From: Micaiah Martin <77340197+mimartin12@users.noreply.github.com> Date: Mon, 20 Dec 2021 10:49:16 -0700 Subject: [PATCH] Patch version check to allow for redeployments. (#1204) * Added logic for redployment * Applied linting - Prettier config was already updated by Oscar. https://github.com/bitwarden/desktop/commit/b4df834b16d4f5d4162a926a5a308bdb3ebc718b --- .github/workflows/release.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 87265f7331..d1ab1becfc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,15 @@ name: Release on: workflow_dispatch: + inputs: + release_type: + description: 'Release Options' + required: true + default: 'Initial Release' + type: choice + options: + - Initial Release + - Redeploy jobs: setup: @@ -22,7 +31,7 @@ jobs: fi - name: Checkout repo - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 - name: Get Package Version id: retrieve-version @@ -39,7 +48,8 @@ jobs: echo "Latest version: $latest_ver" ver=${{ steps.retrieve-version.outputs.package_version }} echo "Version: $ver" - if [ "$latest_ver" = "$ver" ]; then + if [ "$latest_ver" = "$ver" ] && \ + [ "${{ github.event.inputs.release_type }}" == "Initial Release" ]; then echo "Version has not been bumped!" exit 1 fi @@ -58,7 +68,7 @@ jobs: branch: ${{ steps.branch.outputs.branch-name }} - name: Create release - uses: ncipollo/release-action@95215a3cb6e6a1908b3c44e00b4fdb15548b1e09 # v2.8.5 + uses: ncipollo/release-action@95215a3cb6e6a1908b3c44e00b4fdb15548b1e09 # v2.8.5 env: PKG_VERSION: ${{ steps.retrieve-version.outputs.package_version }} with: @@ -101,10 +111,10 @@ jobs: _PKG_VERSION: ${{ needs.setup.outputs.package_version }} steps: - name: Checkout Repo - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 - name: Install Snap - uses: samuelmeuli/action-snapcraft@10d7d0a84d9d86098b19f872257df314b0bd8e2d # v1.2.0 + uses: samuelmeuli/action-snapcraft@10d7d0a84d9d86098b19f872257df314b0bd8e2d # v1.2.0 with: snapcraft_token: ${{ secrets.SNAP_TOKEN }} @@ -136,7 +146,7 @@ jobs: _PKG_VERSION: ${{ needs.setup.outputs.package_version }} steps: - name: Checkout Repo - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 - name: Setup Chocolatey run: choco apikey --key $env:CHOCO_API_KEY --source https://push.chocolatey.org/