Skip to content

Commit

Permalink
BRE-272 - Fix CLI release and publish workflows (#10688)
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrassia authored Aug 23, 2024
1 parent 887d192 commit 62666c5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/publish-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,20 @@ on:
default: true
type: boolean

defaults:
run:
working-directory: apps/cli

jobs:
setup:
name: Setup
runs-on: ubuntu-22.04
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' }}
Expand Down Expand Up @@ -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
Expand All @@ -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' }}
Expand Down Expand Up @@ -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/
Expand Down Expand Up @@ -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: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit 62666c5

Please sign in to comment.