Repository navigation
65 lines (54 loc) · 1.55 KB
/
Copy pathrelease.yml
File metadata and controls
65 lines (54 loc) · 1.55 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
60
61
62
63
64
65
name: 'Release and Publish CLI'
on:
push:
tags:
- 'v*'
- '[0-9]+.[0-9]+.[0-9]+*'
concurrency:
group: release-cli-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: write
id-token: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Verify Tag is on main Branch
run: |
git fetch origin main
if ! git merge-base --is-ancestor HEAD origin/main; then
echo "::error::Tag ${{ github.ref_name }} is not on the main branch. CLI publish is restricted to tags on main."
exit 1
fi
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: 'https://registry.npmjs.org'
- name: Install Dependencies
run: bun install --frozen-lockfile
- name: Build Packages
run: bun run build
- name: Publish CLI to npm
run: |
cd packages/cli
npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}