-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (68 loc) · 2.1 KB
/
release-app.yml
File metadata and controls
77 lines (68 loc) · 2.1 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
name: Release App
on:
workflow_dispatch:
inputs:
version:
description: "Version to publish (e.g., 0.1.0)"
required: true
type: string
dry-run:
description: "Dry run (don't actually publish)"
required: false
type: boolean
default: false
jobs:
release:
name: Build and Publish App
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- 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: "20"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: bun install
working-directory: packages/app
- name: Update version
run: |
cd packages/app
bun -e "
const pkg = await Bun.file('package.json').json();
pkg.version = '${{ inputs.version }}';
pkg.optionalDependencies = {
'@t-req/app-darwin-arm64': '${{ inputs.version }}',
'@t-req/app-darwin-x64': '${{ inputs.version }}',
'@t-req/app-linux-arm64': '${{ inputs.version }}',
'@t-req/app-linux-x64': '${{ inputs.version }}',
'@t-req/app-windows-x64': '${{ inputs.version }}',
};
await Bun.write('package.json', JSON.stringify(pkg, null, 2));
"
- name: Build and Publish
run: |
cd packages/app
if [ "${{ inputs.dry-run }}" = "true" ]; then
bun run script/publish.ts --dry-run
else
bun run script/publish.ts
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub Release
if: ${{ !inputs.dry-run }}
run: |
gh release create app-v${{ inputs.version }} \
--title "App v${{ inputs.version }}" \
--generate-notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}