-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (93 loc) · 3.04 KB
/
release-cli.yml
File metadata and controls
114 lines (93 loc) · 3.04 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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Release CLI
on:
push:
tags:
- 'cli-v*.*.*'
jobs:
release:
name: Release CLI to npm
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.5
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/cli-v}" >> $GITHUB_OUTPUT
- name: Update package version
working-directory: packages/cli
run: |
bun run --bun -e "
const pkg = require('./package.json');
pkg.version = '${{ steps.version.outputs.VERSION }}';
await Bun.write('./package.json', JSON.stringify(pkg, null, 2) + '\n');
"
- name: Build CLI package
working-directory: packages/cli
run: bun run build
- name: Run type check
working-directory: packages/cli
run: bun run typecheck
- name: Verify build artifacts
working-directory: packages/cli
run: |
if [ ! -f dist/index.js ]; then
echo "Error: dist/index.js not found"
exit 1
fi
if [ ! -x dist/index.js ]; then
echo "Error: dist/index.js is not executable"
exit 1
fi
echo "✓ Build artifacts verified"
- name: Setup Node.js (for npm publish)
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Publish to npm
working-directory: packages/cli
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --provenance --access public
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: CLI v${{ steps.version.outputs.VERSION }}
body: |
## @burntop/cli v${{ steps.version.outputs.VERSION }}
### Installation
```bash
npm install -g @burntop/cli
```
Or with bun:
```bash
bun add -g @burntop/cli
```
### What's Changed
See the [CHANGELOG](https://github.com/burntop/burntop/blob/main/packages/cli/CHANGELOG.md) for details.
### Verify Installation
```bash
burntop --version
```
draft: false
prerelease: false
- name: Update Homebrew formula
if: success()
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.HOMEBREW_UPDATE_TOKEN }}
repository: burntop/homebrew-burntop
event-type: update-formula
client-payload: '{"version": "${{ steps.version.outputs.VERSION }}", "tag": "${{ github.ref }}"}'