-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (137 loc) · 5.1 KB
/
release.yml
File metadata and controls
159 lines (137 loc) · 5.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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: Build CLI Binaries
on:
push:
tags:
- 'cli-v*'
workflow_dispatch:
env:
DEBUG: napi:*
MACOSX_DEPLOYMENT_TARGET: '10.13'
permissions:
contents: write
actions: read
jobs:
build:
strategy:
fail-fast: false
matrix:
settings:
- host: macos-latest
target: x86_64-apple-darwin
build: bun run build --target x86_64-apple-darwin
- host: macos-latest
target: aarch64-apple-darwin
build: bun run build --target aarch64-apple-darwin
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
build: bun run build --target x86_64-unknown-linux-gnu
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
build: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc
export CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
bun run build --target aarch64-unknown-linux-gnu
- host: windows-latest
target: x86_64-pc-windows-msvc
build: bun run build --target x86_64-pc-windows-msvc
- host: windows-latest
target: aarch64-pc-windows-msvc
build: bun run build --target aarch64-pc-windows-msvc
name: Build - ${{ matrix.settings.target }}
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.settings.target }}
- name: Install dependencies
run: bun install
working-directory: packages/core
- name: Build native module
run: ${{ matrix.settings.build }}
working-directory: packages/core
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: bindings-${{ matrix.settings.target }}
path: packages/core/*.node
if-no-files-found: error
build-universal-macos:
name: Build - universal-apple-darwin
needs: build
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
working-directory: packages/core
- name: Download x64 artifact
uses: actions/download-artifact@v4
with:
name: bindings-x86_64-apple-darwin
path: packages/core
- name: Download arm64 artifact
uses: actions/download-artifact@v4
with:
name: bindings-aarch64-apple-darwin
path: packages/core
- name: Create universal binary
run: bun x @napi-rs/cli universalize
working-directory: packages/core
- name: Upload universal artifact
uses: actions/upload-artifact@v4
with:
name: bindings-universal-apple-darwin
path: packages/core/*.node
if-no-files-found: error
summary:
name: Build Summary
runs-on: ubuntu-latest
needs:
- build
- build-universal-macos
if: ${{ needs.build.result == 'success' && needs.build-universal-macos.result == 'success' }}
steps:
- uses: actions/checkout@v4
- name: Get version
id: version
run: |
VERSION=$(jq -r .version packages/cli/package.json)
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Summary
run: |
echo "## Build Complete - v${{ steps.version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Artifacts Ready for Download" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "All platform binaries have been built and uploaded as artifacts." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Next Steps (Local Publishing)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "1. Download artifacts:" >> $GITHUB_STEP_SUMMARY
echo " \`\`\`bash" >> $GITHUB_STEP_SUMMARY
echo " gh run download ${{ github.run_id }} -D ./artifacts" >> $GITHUB_STEP_SUMMARY
echo " \`\`\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "2. Run publish script:" >> $GITHUB_STEP_SUMMARY
echo " \`\`\`bash" >> $GITHUB_STEP_SUMMARY
echo " ./scripts/publish-all.sh" >> $GITHUB_STEP_SUMMARY
echo " \`\`\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "3. Verify installation:" >> $GITHUB_STEP_SUMMARY
echo " \`\`\`bash" >> $GITHUB_STEP_SUMMARY
echo " bunx vibetracking@${{ steps.version.outputs.version }} --version" >> $GITHUB_STEP_SUMMARY
echo " \`\`\`" >> $GITHUB_STEP_SUMMARY