From 56ce85c69c72656d3f8d2c10c8341cf19a018ec2 Mon Sep 17 00:00:00 2001 From: Todd Martin <106564991+trmartin4@users.noreply.github.com> Date: Mon, 8 Aug 2022 13:21:49 -0400 Subject: [PATCH] ENG-71 - Updated release workflows with cleanup recommended by Vince (#3224) * Updated release jobs to include fixes that Vince recommended from the mobile repo * Updated the workflows with the fixes that Vince recommended from mobile. * Fix linter errors Co-authored-by: Todd Martin <> Co-authored-by: Michal Checinski --- .github/workflows/release-browser.yml | 12 ++----- .github/workflows/release-cli.yml | 12 ++----- .github/workflows/release-desktop-beta.yml | 37 ++++++++++++++++++++-- .github/workflows/release-desktop.yml | 12 ++----- .github/workflows/release-qa-web.yml | 5 +-- .github/workflows/release-web.yml | 13 ++------ 6 files changed, 50 insertions(+), 41 deletions(-) diff --git a/.github/workflows/release-browser.yml b/.github/workflows/release-browser.yml index 4cb10afb9d..6599212f34 100644 --- a/.github/workflows/release-browser.yml +++ b/.github/workflows/release-browser.yml @@ -95,16 +95,10 @@ jobs: id: deployment with: token: '${{ secrets.GITHUB_TOKEN }}' + initial-status: 'in_progress' environment: 'Browser - Production' description: 'Deployment ${{ needs.setup.outputs.release-version }} from branch ${{ github.ref_name }}' task: release - - - name: Update deployment status to In Progress - uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 - with: - token: '${{ secrets.GITHUB_TOKEN }}' - state: 'in_progress' - deployment-id: ${{ steps.deployment.outputs.deployment_id }} - name: Download latest Release build artifacts if: ${{ github.event.inputs.release_type != 'Dry Run' }} @@ -159,7 +153,7 @@ jobs: draft: true - name: Update deployment status to Success - if: success() + if: ${{ success() }} uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 with: token: '${{ secrets.GITHUB_TOKEN }}' @@ -167,7 +161,7 @@ jobs: deployment-id: ${{ steps.deployment.outputs.deployment_id }} - name: Update deployment status to Failure - if: failure() + if: ${{ failure() }} uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 with: token: '${{ secrets.GITHUB_TOKEN }}' diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 0ce438d0d4..cacb9adfda 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -69,16 +69,10 @@ jobs: id: deployment with: token: '${{ secrets.GITHUB_TOKEN }}' + initial-status: 'in_progress' environment: 'CLI - Production' description: 'Deployment ${{ steps.version.outputs.version }} from branch ${{ github.ref_name }}' task: release - - - name: Update deployment status to In Progress - uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 - with: - token: '${{ secrets.GITHUB_TOKEN }}' - state: 'in_progress' - deployment-id: ${{ steps.deployment.outputs.deployment_id }} - name: Download all Release artifacts if: ${{ github.event.inputs.release_type != 'Dry Run' }} @@ -121,7 +115,7 @@ jobs: draft: true - name: Update deployment status to Success - if: success() + if: ${{ success() }} uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 with: token: '${{ secrets.GITHUB_TOKEN }}' @@ -129,7 +123,7 @@ jobs: deployment-id: ${{ steps.deployment.outputs.deployment_id }} - name: Update deployment status to Failure - if: failure() + if: ${{ failure() }} uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 with: token: '${{ secrets.GITHUB_TOKEN }}' diff --git a/.github/workflows/release-desktop-beta.yml b/.github/workflows/release-desktop-beta.yml index 832178af0c..aec2402d9e 100644 --- a/.github/workflows/release-desktop-beta.yml +++ b/.github/workflows/release-desktop-beta.yml @@ -20,6 +20,7 @@ jobs: release-version: ${{ steps.version.outputs.version }} release-channel: ${{ steps.release-channel.outputs.channel }} branch-name: ${{ steps.branch.outputs.branch-name }} + build_number: ${{ steps.increment-version.outputs.build_number }} steps: - name: Checkout repo uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 @@ -48,12 +49,19 @@ jobs: id: version uses: bitwarden/gh-actions/release-version-check@ea9fab01d76940267b4147cc1c4542431246b9f6 with: - release-type: ${{ github.event.inputs.release_type }} + release-type: 'Initial Release' project-type: ts file: apps/desktop/src/package.json monorepo: true monorepo-project: desktop + - name: Increment Version + id: increment-version + run: | + BUILD_NUMBER=$(expr 3000 + $GITHUB_RUN_NUMBER) + echo "Setting build number to $BUILD_NUMBER" + echo "::set-output name=build_number::$BUILD_NUMBER" + - name: Get Version Channel id: release-channel run: | @@ -907,6 +915,16 @@ jobs: - macos-package-github - macos-package-mas steps: + - name: Create GitHub deployment + uses: chrnorm/deployment-action@1b599fe41a0ef1f95191e7f2eec4743f2d7dfc48 + id: deployment + with: + token: '${{ secrets.GITHUB_TOKEN }}' + initial-status: 'in_progress' + environment: 'Desktop - Beta' + description: 'Deployment ${{ needs.setup.outputs.release-version }} to channel ${{ needs.setup.outputs.release-channel }} from branch ${{ needs.setup.outputs.branch-name }}' + task: release + - name: Login to Azure uses: Azure/login@ec3c14589bd3e9312b3cc8c41e6860e258df9010 with: @@ -926,7 +944,7 @@ jobs: - name: Rename .pkg to .pkg.archive env: - PKG_VERSION: ${{ steps.version.outputs.version }} + PKG_VERSION: ${{ needs.setup.outputs.release-version }} working-directory: apps/desktop/artifacts run: mv Bitwarden-${{ env.PKG_VERSION }}-universal.pkg Bitwarden-${{ env.PKG_VERSION }}-universal.pkg.archive @@ -943,6 +961,21 @@ jobs: --recursive \ --quiet + - name: Update deployment status to Success + if: ${{ success() }} + uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 + with: + token: '${{ secrets.GITHUB_TOKEN }}' + state: 'success' + deployment-id: ${{ steps.deployment.outputs.deployment_id }} + + - name: Update deployment status to Failure + if: ${{ failure() }} + uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 + with: + token: '${{ secrets.GITHUB_TOKEN }}' + state: 'failure' + deployment-id: ${{ steps.deployment.outputs.deployment_id }} remove-branch: name: Remove branch diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml index b230fc92ed..dad38a80ba 100644 --- a/.github/workflows/release-desktop.yml +++ b/.github/workflows/release-desktop.yml @@ -81,16 +81,10 @@ jobs: id: deployment with: token: '${{ secrets.GITHUB_TOKEN }}' + initial-status: 'in_progress' environment: 'Desktop - Production' description: 'Deployment ${{ steps.version.outputs.version }} to channel ${{ steps.release-channel.outputs.channel }} from branch ${{ github.ref_name }}' task: release - - - name: Update deployment status to In Progress - uses: chrnorm/deployment-status@1b599fe41a0ef1f95191e7f2eec4743f2d7dfc48 - with: - token: '${{ secrets.GITHUB_TOKEN }}' - state: 'failure' - deployment-id: ${{ steps.deployment.outputs.deployment_id }} - name: Login to Azure uses: Azure/login@ec3c14589bd3e9312b3cc8c41e6860e258df9010 @@ -181,7 +175,7 @@ jobs: draft: true - name: Update deployment status to Success - if: success() + if: ${{ success() }} uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 with: token: '${{ secrets.GITHUB_TOKEN }}' @@ -189,7 +183,7 @@ jobs: deployment-id: ${{ steps.deployment.outputs.deployment_id }} - name: Update deployment status to Failure - if: failure() + if: ${{ failure() }} uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 with: token: '${{ secrets.GITHUB_TOKEN }}' diff --git a/.github/workflows/release-qa-web.yml b/.github/workflows/release-qa-web.yml index d9a3fa3c1b..14eb5a4c67 100644 --- a/.github/workflows/release-qa-web.yml +++ b/.github/workflows/release-qa-web.yml @@ -77,6 +77,7 @@ jobs: id: deployment with: token: '${{ secrets.GITHUB_TOKEN }}' + initial-status: 'in_progress' environment-url: http://vault.qa.bitwarden.pw environment: 'Web Vault - QA' description: 'Deployment from branch ${{ github.ref_name }}' @@ -137,7 +138,7 @@ jobs: working-directory: deployment - name: Update deployment status to Success - if: success() + if: ${{ success() }} uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 with: token: '${{ secrets.GITHUB_TOKEN }}' @@ -146,7 +147,7 @@ jobs: deployment-id: ${{ steps.deployment.outputs.deployment_id }} - name: Update deployment status to Failure - if: failure() + if: ${{ failure() }} uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 with: token: '${{ secrets.GITHUB_TOKEN }}' diff --git a/.github/workflows/release-web.yml b/.github/workflows/release-web.yml index 665be527c0..7dd828cc5f 100644 --- a/.github/workflows/release-web.yml +++ b/.github/workflows/release-web.yml @@ -232,18 +232,11 @@ jobs: id: deployment with: token: '${{ secrets.GITHUB_TOKEN }}' + initial-status: 'in_progress' environment-url: http://vault.bitwarden.com environment: 'Web Vault - Production' description: 'Deployment ${{ needs.setup.outputs.release_version }} from branch ${{ github.ref_name }}' task: release - - - name: Update deployment status to In Progress - uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 - with: - token: '${{ secrets.GITHUB_TOKEN }}' - environment-url: http://vault.bitwarden.com - state: 'in_progress' - deployment-id: ${{ steps.deployment.outputs.deployment_id }} - name: Download latest build artifacts if: ${{ github.event.inputs.release_type != 'Dry Run' }} @@ -287,7 +280,7 @@ jobs: draft: true - name: Update deployment status to Success - if: success() + if: ${{ success() }} uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 with: token: '${{ secrets.GITHUB_TOKEN }}' @@ -296,7 +289,7 @@ jobs: deployment-id: ${{ steps.deployment.outputs.deployment_id }} - name: Update deployment status to Failure - if: failure() + if: ${{ failure() }} uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 with: token: '${{ secrets.GITHUB_TOKEN }}'