-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.8 KB
/
release.yml
File metadata and controls
59 lines (50 loc) · 1.8 KB
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
name: Release
on:
workflow_run:
workflows: ['CI Tests']
types:
- completed
branches:
- master
workflow_dispatch:
permissions:
contents: write # To push release tags and updated files like package.json, CHANGELOG.md
id-token: write # To enable OIDC for npm provenance (publishing)
issues: write # To create/comment on issues/PRs (e.g., by @semantic-release/github)
pull-requests: write # To create/comment on issues/PRs (e.g., by @semantic-release/github)
concurrency:
group: release
cancel-in-progress: true
jobs:
release:
name: Semantic Release
runs-on: ubuntu-latest
# Condition to run the job: either a manual dispatch or a successful completion of 'CI Tests' workflow on the master branch
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetches all history for all branches and tags, required for semantic-release
persist-credentials: false # Recommended for semantic-release to push changes
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Restore Bun cache
uses: actions/cache@v4
id: bun-cache
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build package
run: bun run build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: bunx semantic-release