2022-05-31 07:20:06 -06:00
|
|
|
name: Release CLI
|
2022-11-08 15:02:51 +00:00
|
|
|
run-name: Release CLI ${{ inputs.release_type }}
|
2021-01-27 19:15:29 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2021-12-20 13:19:31 -07:00
|
|
|
inputs:
|
|
|
|
release_type:
|
|
|
|
description: 'Release Options'
|
|
|
|
required: true
|
|
|
|
default: 'Initial Release'
|
|
|
|
type: choice
|
|
|
|
options:
|
|
|
|
- Initial Release
|
|
|
|
- Redeploy
|
2022-02-25 08:12:07 -06:00
|
|
|
- Dry Run
|
2021-01-27 19:15:29 +00:00
|
|
|
|
2022-05-31 07:20:06 -06:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: apps/cli
|
|
|
|
|
2021-01-27 19:15:29 +00:00
|
|
|
jobs:
|
|
|
|
setup:
|
2021-09-02 16:04:02 -04:00
|
|
|
name: Setup
|
2024-02-08 15:56:39 -05:00
|
|
|
runs-on: ubuntu-22.04
|
2021-01-27 19:15:29 +00:00
|
|
|
outputs:
|
2022-06-01 10:03:05 -07:00
|
|
|
release-version: ${{ steps.version.outputs.version }}
|
2021-01-27 19:15:29 +00:00
|
|
|
steps:
|
2022-06-30 10:26:35 -07:00
|
|
|
- name: Checkout repo
|
2024-10-30 11:29:15 -04:00
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2022-06-30 10:26:35 -07:00
|
|
|
|
2021-06-01 13:50:53 -07:00
|
|
|
- name: Branch check
|
2024-08-22 08:24:26 -04:00
|
|
|
if: ${{ inputs.release_type != 'Dry Run' }}
|
2021-06-01 13:50:53 -07:00
|
|
|
run: |
|
2022-11-16 10:48:49 -05:00
|
|
|
if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ "$GITHUB_REF" != "refs/heads/hotfix-rc-cli" ]]; then
|
2021-06-01 13:50:53 -07:00
|
|
|
echo "==================================="
|
2022-08-16 08:55:57 -07:00
|
|
|
echo "[!] Can only release from the 'rc' or 'hotfix-rc-cli' branches"
|
2021-06-01 13:50:53 -07:00
|
|
|
echo "==================================="
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-06-01 10:03:05 -07:00
|
|
|
- name: Check Release Version
|
|
|
|
id: version
|
2023-11-08 13:08:34 -05:00
|
|
|
uses: bitwarden/gh-actions/release-version-check@main
|
2022-06-01 10:03:05 -07:00
|
|
|
with:
|
2024-08-22 08:24:26 -04:00
|
|
|
release-type: ${{ inputs.release_type }}
|
2022-06-01 10:03:05 -07:00
|
|
|
project-type: ts
|
|
|
|
file: apps/cli/package.json
|
|
|
|
monorepo: true
|
|
|
|
monorepo-project: cli
|
2021-10-05 16:20:18 -04:00
|
|
|
|
2024-08-09 00:55:13 +02:00
|
|
|
release:
|
|
|
|
name: Release
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
needs: setup
|
|
|
|
steps:
|
2022-07-01 08:44:20 -07:00
|
|
|
- name: Download all Release artifacts
|
2024-08-22 08:24:26 -04:00
|
|
|
if: ${{ inputs.release_type != 'Dry Run' }}
|
2023-11-08 13:08:34 -05:00
|
|
|
uses: bitwarden/gh-actions/download-artifacts@main
|
2021-10-05 16:20:18 -04:00
|
|
|
with:
|
2022-05-31 07:20:06 -06:00
|
|
|
workflow: build-cli.yml
|
|
|
|
path: apps/cli
|
2021-10-05 16:20:18 -04:00
|
|
|
workflow_conclusion: success
|
2022-06-22 08:32:45 -04:00
|
|
|
branch: ${{ github.ref_name }}
|
2021-10-05 16:20:18 -04:00
|
|
|
|
2022-11-14 14:35:42 +00:00
|
|
|
- name: Dry Run - Download all artifacts
|
2024-08-22 08:24:26 -04:00
|
|
|
if: ${{ inputs.release_type == 'Dry Run' }}
|
2023-11-08 13:08:34 -05:00
|
|
|
uses: bitwarden/gh-actions/download-artifacts@main
|
2022-07-01 08:44:20 -07:00
|
|
|
with:
|
|
|
|
workflow: build-cli.yml
|
|
|
|
path: apps/cli
|
|
|
|
workflow_conclusion: success
|
2023-12-12 11:57:50 -08:00
|
|
|
branch: main
|
2022-07-01 08:44:20 -07:00
|
|
|
|
2021-10-05 16:20:18 -04:00
|
|
|
- name: Create release
|
2024-08-22 08:24:26 -04:00
|
|
|
if: ${{ inputs.release_type != 'Dry Run' }}
|
2024-02-08 14:38:19 -05:00
|
|
|
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
|
2021-10-05 16:20:18 -04:00
|
|
|
env:
|
2024-08-22 08:24:26 -04:00
|
|
|
PKG_VERSION: ${{ needs.setup.outputs.release-version }}
|
2021-01-27 19:15:29 +00:00
|
|
|
with:
|
2024-05-24 09:36:26 -05:00
|
|
|
artifacts: "apps/cli/bw-oss-windows-${{ env.PKG_VERSION }}.zip,
|
|
|
|
apps/cli/bw-oss-windows-sha256-${{ env.PKG_VERSION }}.txt,
|
2024-06-27 12:47:52 -04:00
|
|
|
apps/cli/bw-windows-${{ env.PKG_VERSION }}.zip,
|
|
|
|
apps/cli/bw-windows-sha256-${{ env.PKG_VERSION }}.txt,
|
2024-05-24 09:36:26 -05:00
|
|
|
apps/cli/bw-oss-macos-${{ env.PKG_VERSION }}.zip,
|
|
|
|
apps/cli/bw-oss-macos-sha256-${{ env.PKG_VERSION }}.txt,
|
2024-06-27 12:47:52 -04:00
|
|
|
apps/cli/bw-macos-${{ env.PKG_VERSION }}.zip,
|
|
|
|
apps/cli/bw-macos-sha256-${{ env.PKG_VERSION }}.txt,
|
2024-05-24 09:36:26 -05:00
|
|
|
apps/cli/bw-oss-linux-${{ env.PKG_VERSION }}.zip,
|
|
|
|
apps/cli/bw-oss-linux-sha256-${{ env.PKG_VERSION }}.txt,
|
2024-06-27 12:47:52 -04:00
|
|
|
apps/cli/bw-linux-${{ env.PKG_VERSION }}.zip,
|
|
|
|
apps/cli/bw-linux-sha256-${{ env.PKG_VERSION }}.txt,
|
2022-05-31 07:20:06 -06:00
|
|
|
apps/cli/bitwarden-cli.${{ env.PKG_VERSION }}.nupkg,
|
|
|
|
apps/cli/bw_${{ env.PKG_VERSION }}_amd64.snap,
|
2024-08-22 21:29:39 -04:00
|
|
|
apps/cli/bw-snap-sha256-${{ env.PKG_VERSION }}.txt,
|
|
|
|
apps/cli/bitwarden-cli-${{ env.PKG_VERSION }}-npm-build.zip"
|
2021-10-05 16:20:18 -04:00
|
|
|
commit: ${{ github.sha }}
|
2022-05-31 07:20:06 -06:00
|
|
|
tag: cli-v${{ env.PKG_VERSION }}
|
|
|
|
name: CLI v${{ env.PKG_VERSION }}
|
2021-10-05 16:20:18 -04:00
|
|
|
body: "<insert release notes here>"
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2021-01-27 19:15:29 +00:00
|
|
|
draft: true
|