-
Notifications
You must be signed in to change notification settings - Fork 50
76 lines (69 loc) · 2.71 KB
/
release-bws.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Release bws CLI
run-name: Release bws CLI ${{ inputs.release_type }}
on:
workflow_dispatch:
inputs:
release_type:
description: "Release Options"
required: true
default: "Release"
type: choice
options:
- Release
- Dry Run
jobs:
setup:
name: Setup
runs-on: ubuntu-22.04
outputs:
release-version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Branch check
if: ${{ inputs.release_type != 'Dry Run' }}
run: |
if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then
echo "==================================="
echo "[!] Can only release from the 'main' branch"
echo "==================================="
exit 1
fi
- name: Check Release Version
id: version
run: |
VERSION=$(grep -o '^version = ".*"' crates/bws/Cargo.toml | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+")
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Download all Release artifacts
uses: bitwarden/gh-actions/download-artifacts@main
with:
workflow: build-cli.yml
path: packages
workflow_conclusion: success
branch: ${{ github.ref_name }}
- name: Get checksum files
uses: bitwarden/gh-actions/get-checksum@main
with:
packages_dir: "packages"
file_path: "packages/bws-sha256-checksums-${{ steps.version.outputs.version }}.txt"
- name: Create release
if: ${{ inputs.release_type != 'Dry Run' }}
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
env:
PKG_VERSION: ${{ steps.version.outputs.version }}
with:
artifacts: "packages/bws-x86_64-apple-darwin-${{ env.PKG_VERSION }}.zip,
packages/bws-aarch64-apple-darwin-${{ env.PKG_VERSION }}.zip,
packages/bws-macos-universal-${{ env.PKG_VERSION }}.zip,
packages/bws-x86_64-pc-windows-msvc-${{ env.PKG_VERSION }}.zip,
packages/bws-aarch64-pc-windows-msvc-${{ env.PKG_VERSION }}.zip,
packages/bws-x86_64-unknown-linux-gnu-${{ env.PKG_VERSION }}.zip,
packages/bws-aarch64-unknown-linux-gnu-${{ env.PKG_VERSION }}.zip,
packages/THIRDPARTY.html,
packages/bws-sha256-checksums-${{ env.PKG_VERSION }}.txt"
commit: ${{ github.sha }}
tag: bws-v${{ env.PKG_VERSION }}
name: bws CLI v${{ env.PKG_VERSION }}
body: "<insert release notes here>"
token: ${{ secrets.GITHUB_TOKEN }}
draft: true