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