-
Notifications
You must be signed in to change notification settings - Fork 50
95 lines (86 loc) · 2.77 KB
/
release-napi.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Release @bitwarden/sdk-napi
run-name: Release @bitwarden/sdk-napi ${{ inputs.release_type }}
on:
workflow_dispatch:
inputs:
release_type:
description: "Release Options"
required: true
default: "Initial Release"
type: choice
options:
- Initial Release
- Redeploy
- Dry Run
defaults:
run:
shell: bash
working-directory: crates/bitwarden-napi
jobs:
setup:
name: Setup
runs-on: ubuntu-22.04
outputs:
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
uses: bitwarden/gh-actions/release-version-check@main
with:
release-type: ${{ inputs.release_type }}
project-type: ts
file: crates/bitwarden-napi/package.json
monorepo: false
release:
name: Create GitHub release
runs-on: ubuntu-22.04
needs: setup
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Download artifacts
uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6
with:
workflow: build-napi.yml
workflow_conclusion: success
branch: main
name: sdk-bitwarden-napi-(.*)|schemas.ts
name_is_regexp: true
path: dist
- name: Move artifact files to single directory
run: |
ls -alhR
shopt -s globstar
mv **/*.node .
mv schemas.ts/ schemas/
mv schemas/schemas.ts .
working-directory: dist
- name: Create release
if: ${{ inputs.release_type != 'Dry Run' }}
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
env:
_VERSION: ${{ needs.setup.outputs.version }}
with:
commit: ${{ github.sha }}
tag: napi-v${{ env._VERSION }}
name: napi v${{ env._VERSION }}
body: "<insert release notes here>"
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
artifacts: |
dist/sdk-napi.darwin-arm64.node
dist/sdk-napi.darwin-x64.node
dist/sdk-napi.win32-x64-msvc.node
dist/sdk-napi.linux-x64-gnu.node
dist/schemas.ts