diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index c4ca132adf..31b5f058c8 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -134,6 +134,7 @@ jobs: snapcraft_token: ${{ steps.retrieve-secrets.outputs.snapcraft-store-token }} - name: Download artifacts + if: ${{ github.event.inputs.release_type != 'Dry Run' }} uses: bitwarden/gh-actions/download-artifacts@c1fa8e09871a860862d6bbe36184b06d2c7e35a8 with: workflow: build-cli.yml @@ -142,6 +143,16 @@ jobs: branch: ${{ github.ref_name }} artifacts: bw_${{ env._PKG_VERSION }}_amd64.snap + - name: Download artifacts + if: ${{ github.event.inputs.release_type == 'Dry Run' }} + uses: bitwarden/gh-actions/download-artifacts@c1fa8e09871a860862d6bbe36184b06d2c7e35a8 + with: + workflow: build-cli.yml + path: apps/cli + workflow_conclusion: success + branch: master + artifacts: bw_${{ env._PKG_VERSION }}_amd64.snap + - name: Publish Snap & logout if: ${{ github.event.inputs.release_type != 'Dry Run' }} run: | @@ -182,6 +193,7 @@ jobs: run: New-Item -ItemType directory -Path ./dist - name: Download artifacts + if: ${{ github.event.inputs.release_type != 'Dry Run' }} uses: bitwarden/gh-actions/download-artifacts@c1fa8e09871a860862d6bbe36184b06d2c7e35a8 with: workflow: build-cli.yml @@ -190,6 +202,16 @@ jobs: branch: ${{ github.ref_name }} artifacts: bitwarden-cli.${{ env._PKG_VERSION }}.nupkg + - name: Download artifacts + if: ${{ github.event.inputs.release_type == 'Dry Run' }} + uses: bitwarden/gh-actions/download-artifacts@c1fa8e09871a860862d6bbe36184b06d2c7e35a8 + with: + workflow: build-cli.yml + path: apps/cli/dist + workflow_conclusion: success + branch: master + artifacts: bitwarden-cli.${{ env._PKG_VERSION }}.nupkg + - name: Push to Chocolatey if: ${{ github.event.inputs.release_type != 'Dry Run' }} shell: pwsh @@ -222,6 +244,7 @@ jobs: secrets: "cli-npm-api-key" - name: Download artifacts + if: ${{ github.event.inputs.release_type != 'Dry Run' }} uses: bitwarden/gh-actions/download-artifacts@c1fa8e09871a860862d6bbe36184b06d2c7e35a8 with: workflow: build-cli.yml @@ -230,6 +253,16 @@ jobs: branch: ${{ github.ref_name }} artifacts: bitwarden-cli-${{ env._PKG_VERSION }}-npm-build.zip + - name: Download artifacts + if: ${{ github.event.inputs.release_type == 'Dry Run' }} + uses: bitwarden/gh-actions/download-artifacts@c1fa8e09871a860862d6bbe36184b06d2c7e35a8 + with: + workflow: build-cli.yml + path: apps/cli/build + workflow_conclusion: success + branch: master + artifacts: bitwarden-cli-${{ env._PKG_VERSION }}-npm-build.zip + - name: Setup NPM run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc env: diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml index 338b84c538..f6fd411a24 100644 --- a/.github/workflows/release-desktop.yml +++ b/.github/workflows/release-desktop.yml @@ -198,6 +198,7 @@ jobs: working-directory: apps/desktop - name: Download Snap artifact + if: ${{ github.event.inputs.release_type != 'Dry Run' }} uses: bitwarden/gh-actions/download-artifacts@23433be15ed6fd046ce12b6889c5184a8d9c8783 with: workflow: build-desktop.yml @@ -206,6 +207,16 @@ jobs: artifacts: bitwarden_${{ env._PKG_VERSION }}_amd64.snap path: apps/desktop/dist + - name: Download Snap artifact + if: ${{ github.event.inputs.release_type == 'Dry Run' }} + uses: bitwarden/gh-actions/download-artifacts@23433be15ed6fd046ce12b6889c5184a8d9c8783 + with: + workflow: build-desktop.yml + workflow_conclusion: success + branch: master + artifacts: bitwarden_${{ env._PKG_VERSION }}_amd64.snap + path: apps/desktop/dist + - name: Deploy to Snap Store if: ${{ github.event.inputs.release_type != 'Dry Run' }} run: | @@ -253,6 +264,7 @@ jobs: working-directory: apps/desktop - name: Download choco artifact + if: ${{ github.event.inputs.release_type != 'Dry Run' }} uses: bitwarden/gh-actions/download-artifacts@23433be15ed6fd046ce12b6889c5184a8d9c8783 with: workflow: build-desktop.yml @@ -261,6 +273,16 @@ jobs: artifacts: bitwarden.${{ env._PKG_VERSION }}.nupkg path: apps/desktop/dist + - name: Download choco artifact + if: ${{ github.event.inputs.release_type == 'Dry Run' }} + uses: bitwarden/gh-actions/download-artifacts@23433be15ed6fd046ce12b6889c5184a8d9c8783 + with: + workflow: build-desktop.yml + workflow_conclusion: success + branch: master + artifacts: bitwarden.${{ env._PKG_VERSION }}.nupkg + path: apps/desktop/dist + - name: Push to Chocolatey if: ${{ github.event.inputs.release_type != 'Dry Run' }} shell: pwsh diff --git a/.github/workflows/release-web.yml b/.github/workflows/release-web.yml index 9fedc30e52..1db2b6dbe2 100644 --- a/.github/workflows/release-web.yml +++ b/.github/workflows/release-web.yml @@ -153,6 +153,7 @@ jobs: uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 - name: Download latest cloud asset + if: ${{ github.event.inputs.release_type != 'Dry Run' }} uses: bitwarden/gh-actions/download-artifacts@c1fa8e09871a860862d6bbe36184b06d2c7e35a8 with: workflow: build-web.yml @@ -161,6 +162,16 @@ jobs: branch: ${{ github.ref_name }} artifacts: web-*-cloud-COMMERCIAL.zip + - name: Download latest cloud asset + if: ${{ github.event.inputs.release_type == 'Dry Run' }} + uses: bitwarden/gh-actions/download-artifacts@c1fa8e09871a860862d6bbe36184b06d2c7e35a8 + with: + workflow: build-web.yml + path: apps/web + workflow_conclusion: success + branch: master + artifacts: web-*-cloud-COMMERCIAL.zip + # This should result in a build directory in the current working directory - name: Unzip build asset working-directory: apps/web @@ -190,7 +201,10 @@ jobs: git switch -c cf-pages-deploy-$_TAG_VERSION git add . git commit -m "Staging deploy ${{ needs.setup.outputs.release_version }}" - git push -u origin cf-pages-deploy-$_TAG_VERSION + + if [[ "${{ github.event.inputs.release_type }}" != "Dry Run" ]]; then + git push -u origin cf-pages-deploy-$_TAG_VERSION + fi working-directory: deployment - name: Create CloudFlare Pages Deploy PR @@ -253,20 +267,3 @@ jobs: apps/web/artifacts/web-${{ needs.setup.outputs.release_version }}-selfhosted-open-source.zip" token: ${{ secrets.GITHUB_TOKEN }} draft: true - - - dry-run: - name: Dry Run Cleanup - runs-on: ubuntu-20.04 - if: ${{ github.event.inputs.release_type == 'Dry Run' }} - env: - _TAG_VERSION: ${{ needs.setup.outputs.tag_version }} - needs: - - setup - - release - steps: - - name: Checkout repo - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 - - - name: Remove cf-pages-deploy branch - run: git push origin --delete cf-pages-deploy-$_TAG_VERSION