Skip to content

Commit 7ec7f61

Browse files
fix: update release yaml to follow semantic release gha
Ticket: WP-5314
1 parent 525671d commit 7ec7f61

File tree

1 file changed

+69
-20
lines changed

1 file changed

+69
-20
lines changed

.github/workflows/release.yaml

Lines changed: 69 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,81 @@
22
name: Release
33

44
permissions:
5-
# Required by AWS CodeArtifact
6-
id-token: write
7-
85
# Required by semantic-release
96
contents: write
107
pull-requests: write
118
issues: write
129

1310
on:
14-
push:
15-
branches:
16-
- master
17-
- next
18-
- next-major
19-
- beta
20-
- alpha
21-
- "[0-9]+.[0-9]+.x"
22-
- "[0-9]+.x"
11+
workflow_dispatch:
12+
inputs:
13+
dry_run:
14+
description: 'Dry run (no actual release)'
15+
required: false
16+
type: boolean
17+
default: false
18+
pre_release:
19+
description: 'Create a pre-release (alpha/beta)'
20+
required: false
21+
type: choice
22+
options:
23+
- ''
24+
- 'alpha'
25+
- 'beta'
26+
default: ''
2327

2428
jobs:
2529
release:
26-
uses: BitGo/gha-release-typescript-library/.github/workflows/release.yml@v3
27-
with:
28-
lint-node-version: '22.x'
29-
test-node-versions: '["22.x"]'
30-
release-node-version: '22.x'
31-
build-command: 'yarn build'
32-
test-command: 'yarn test'
33-
allow-postinstall-scripts: false
30+
name: Release
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0
37+
persist-credentials: false
38+
39+
- name: Setup Node.js
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: '22.x'
43+
cache: 'yarn'
44+
45+
- name: Cache dependencies
46+
uses: actions/cache@v4
47+
id: node-modules-cache
48+
with:
49+
path: '**/node_modules'
50+
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
51+
restore-keys: |
52+
${{ runner.os }}-modules-
53+
54+
- name: Install dependencies
55+
if: steps.node-modules-cache.outputs.cache-hit != 'true'
56+
run: yarn install
57+
58+
- name: Build
59+
run: yarn build
60+
61+
- name: Test
62+
run: yarn test
63+
env:
64+
NODE_OPTIONS: '--max-old-space-size=4096'
65+
MASTER_BITGO_EXPRESS_KEYPATH: ./test-ssl-key.pem
66+
MASTER_BITGO_EXPRESS_CRTPATH: ./test-ssl-cert.pem
67+
MTLS_ENABLED: true
68+
MTLS_REQUEST_CERT: true
69+
MTLS_REJECT_UNAUTHORIZED: false
70+
KMS_URL: 'https://localhost:3000/'
71+
72+
- name: Release
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
DRY_RUN: ${{ github.event.inputs.dry_run }}
76+
PRE_RELEASE: ${{ github.event.inputs.pre_release }}
77+
run: |
78+
if [ -n "$PRE_RELEASE" ]; then
79+
npx semantic-release --prerelease $PRE_RELEASE${DRY_RUN == 'true' && ' --dry-run' || ''}
80+
else
81+
npx semantic-release${DRY_RUN == 'true' && ' --dry-run' || ''}
82+
fi

0 commit comments

Comments
 (0)