From 62666c51f5ae429ed334cacd5de76450ae78f227 Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Thu, 22 Aug 2024 21:29:39 -0400 Subject: [PATCH] BRE-272 - Fix CLI release and publish workflows (#10688) --- .github/workflows/publish-cli.yml | 19 +++++++++++-------- .github/workflows/publish-web.yml | 4 ++-- .github/workflows/release-cli.yml | 3 ++- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish-cli.yml b/.github/workflows/publish-cli.yml index a7bb9ae8df..db91f1401c 100644 --- a/.github/workflows/publish-cli.yml +++ b/.github/workflows/publish-cli.yml @@ -35,6 +35,10 @@ on: default: true type: boolean +defaults: + run: + working-directory: apps/cli + jobs: setup: name: Setup @@ -42,6 +46,9 @@ jobs: outputs: release-version: ${{ steps.version-output.outputs.version }} deployment-id: ${{ steps.deployment.outputs.deployment_id }} + defaults: + run: + working-directory: . steps: - name: Branch check if: ${{ inputs.publish_type != 'Dry Run' }} @@ -83,9 +90,6 @@ jobs: if: inputs.snap_publish env: _PKG_VERSION: ${{ needs.setup.outputs.release-version }} - defaults: - run: - working-directory: apps/cli steps: - name: Checkout repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -106,7 +110,7 @@ jobs: uses: samuelmeuli/action-snapcraft@d33c176a9b784876d966f80fb1b461808edc0641 # v2.1.1 - name: Download artifacts - run: wget https://github.com/bitwarden/clients/releases/cli-v${{ env._PKG_VERSION }}/download/bw_${{ env._PKG_VERSION }}_amd64.snap + run: wget https://github.com/bitwarden/clients/releases/download/cli-v${{ env._PKG_VERSION }}/bw_${{ env._PKG_VERSION }}_amd64.snap - name: Publish Snap & logout if: ${{ inputs.publish_type != 'Dry Run' }} @@ -145,15 +149,14 @@ jobs: CHOCO_API_KEY: ${{ steps.retrieve-secrets.outputs.cli-choco-api-key }} - name: Make dist dir - shell: pwsh run: New-Item -ItemType directory -Path ./dist - name: Download artifacts - run: wget https://github.com/bitwarden/clients/releases/cli-v${{ env._PKG_VERSION }}/download/bitwarden-cli.${{ env._PKG_VERSION }}.nupkg + shell: bash + run: wget https://github.com/bitwarden/clients/releases/download/cli-v${{ env._PKG_VERSION }}/bitwarden-cli.${{ env._PKG_VERSION }}.nupkg - name: Push to Chocolatey if: ${{ inputs.publish_type != 'Dry Run' }} - shell: pwsh run: | cd dist choco push --source=https://push.chocolatey.org/ @@ -182,7 +185,7 @@ jobs: secrets: "npm-api-key" - name: Download artifacts - run: wget https://github.com/bitwarden/clients/releases/cli-v${{ env._PKG_VERSION }}/download/bitwarden-cli-${{ env._PKG_VERSION }}-npm-build.zip + run: wget https://github.com/bitwarden/clients/releases/download/cli-v${{ env._PKG_VERSION }}/bitwarden-cli-${{ env._PKG_VERSION }}-npm-build.zip - name: Setup NPM run: | diff --git a/.github/workflows/publish-web.yml b/.github/workflows/publish-web.yml index c22bcdc370..b7ea849859 100644 --- a/.github/workflows/publish-web.yml +++ b/.github/workflows/publish-web.yml @@ -8,10 +8,10 @@ on: publish_type: description: 'Publish Options' required: true - default: 'Initial Publish' + default: 'Initial Release' type: choice options: - - Initial Publish + - Initial Release - Redeploy - Dry Run diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 19d0677f6d..ddcdb4e904 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -92,7 +92,8 @@ jobs: apps/cli/bw-linux-sha256-${{ env.PKG_VERSION }}.txt, apps/cli/bitwarden-cli.${{ env.PKG_VERSION }}.nupkg, apps/cli/bw_${{ env.PKG_VERSION }}_amd64.snap, - apps/cli/bw-snap-sha256-${{ env.PKG_VERSION }}.txt" + apps/cli/bw-snap-sha256-${{ env.PKG_VERSION }}.txt, + apps/cli/bitwarden-cli-${{ env.PKG_VERSION }}-npm-build.zip" commit: ${{ github.sha }} tag: cli-v${{ env.PKG_VERSION }} name: CLI v${{ env.PKG_VERSION }}