1name: Build Binaries
2
3on:
4 workflow_call:
5 inputs:
6 version:
7 required: true
8 type: string
9 release_id:
10 required: true
11 type: string
12
13jobs:
14 build-windows:
15 name: "Windows (x64)"
16 runs-on: windows-latest
17 steps:
18 - name: Checkout project
19 uses: actions/checkout@v4
20
21 - name: Setup Bun
22 uses: oven-sh/setup-bun@v2
23 with:
24 bun-version: latest
25
26 - name: Install client dependencies
27 working-directory: client
28 run: bun install
29
30 - name: Build client
31 working-directory: client
32 run: bun run build
33
34 - name: Move build folder
35 run: Move-Item -Path client/build -Destination .
36
37 - name: Install server dependencies
38 run: bun install
39
40 - name: Generate migrations
41 run: bun run generate-migrations
42
43 - name: Generate integrations
44 run: bun run generate-integrations
45
46 - name: Generate client embed
47 run: bun run generate-client-embed
48
49 - name: Compile binary
50 run: bun build --compile --compile-autoload-package-json --external pg-hstore --external pg --target=bun-windows-x64 server/index.js --outfile Pixies.exe
51
52 - name: Upload to Release
53 uses: actions/github-script@v7
54 with:
55 script: |
56 const fs = require('fs');
57 await github.rest.repos.uploadReleaseAsset({
58 owner: context.repo.owner,
59 repo: context.repo.repo,
60 release_id: ${{ inputs.release_id }},
61 name: 'Pixies-windows-x64.exe',
62 data: fs.readFileSync('Pixies.exe')
63 });
64
65 - name: Upload artifact for MSI
66 uses: actions/upload-artifact@v4
67 with:
68 name: Pixies-windows-x64.exe
69 path: Pixies.exe
70
71 - name: Upload build folder for MSI
72 uses: actions/upload-artifact@v4
73 with:
74 name: build-folder
75 path: build
76
77 build-linux:
78 name: "Linux (${{ matrix.arch }})"
79 runs-on: ${{ matrix.runner }}
80 strategy:
81 fail-fast: false
82 matrix:
83 include:
84 - arch: x64
85 target: bun-linux-x64
86 runner: ubuntu-latest
87 artifact_name: Pixies-linux-x64
88 - arch: arm64
89 target: bun-linux-arm64
90 runner: ubuntu-24.04-arm
91 artifact_name: Pixies-linux-arm64
92
93 steps:
94 - name: Checkout project
95 uses: actions/checkout@v4
96
97 - name: Setup Bun
98 uses: oven-sh/setup-bun@v2
99 with:
100 bun-version: latest
101
102 - name: Install client dependencies
103 working-directory: client
104 run: bun install
105
106 - name: Build client
107 working-directory: client
108 run: bun run build
109
110 - name: Move build folder
111 run: mv client/build .
112
113 - name: Install server dependencies
114 run: bun install
115
116 - name: Generate migrations
117 run: bun run generate-migrations
118
119 - name: Generate integrations
120 run: bun run generate-integrations
121
122 - name: Generate client embed
123 run: bun run generate-client-embed
124
125 - name: Compile binary
126 run: bun build --compile --compile-autoload-package-json --external pg-hstore --external pg --target=${{ matrix.target }} server/index.js --outfile Pixies
127
128 - name: Rename binary
129 run: mv Pixies ${{ matrix.artifact_name }}
130
131 - name: Upload to Release
132 uses: actions/github-script@v7
133 with:
134 script: |
135 const fs = require('fs');
136 await github.rest.repos.uploadReleaseAsset({
137 owner: context.repo.owner,
138 repo: context.repo.repo,
139 release_id: ${{ inputs.release_id }},
140 name: '${{ matrix.artifact_name }}',
141 data: fs.readFileSync('${{ matrix.artifact_name }}')
142 });
143
144 build-macos:
145 name: "macOS (${{ matrix.arch }})"
146 runs-on: macos-latest
147 strategy:
148 fail-fast: false
149 matrix:
150 include:
151 - arch: x64
152 target: bun-darwin-x64
153 artifact_name: Pixies-macos-x64
154 - arch: arm64
155 target: bun-darwin-arm64
156 artifact_name: Pixies-macos-arm64
157
158 steps:
159 - name: Checkout project
160 uses: actions/checkout@v4
161
162 - name: Setup Bun
163 uses: oven-sh/setup-bun@v2
164 with:
165 bun-version: latest
166
167 - name: Install client dependencies
168 working-directory: client
169 run: bun install
170
171 - name: Build client
172 working-directory: client
173 run: bun run build
174
175 - name: Move build folder
176 run: mv client/build .
177
178 - name: Install server dependencies
179 run: bun install
180
181 - name: Generate migrations
182 run: bun run generate-migrations
183
184 - name: Generate integrations
185 run: bun run generate-integrations
186
187 - name: Generate client embed
188 run: bun run generate-client-embed
189
190 - name: Compile binary
191 run: bun build --compile --compile-autoload-package-json --external pg-hstore --external pg --target=${{ matrix.target }} server/index.js --outfile Pixies
192
193 - name: Rename binary
194 run: mv Pixies ${{ matrix.artifact_name }}
195
196 - name: Upload to Release
197 uses: actions/github-script@v7
198 with:
199 script: |
200 const fs = require('fs');
201 await github.rest.repos.uploadReleaseAsset({
202 owner: context.repo.owner,
203 repo: context.repo.repo,
204 release_id: ${{ inputs.release_id }},
205 name: '${{ matrix.artifact_name }}',
206 data: fs.readFileSync('${{ matrix.artifact_name }}')
207 });
208
209 build-zip:
210 name: "Source ZIP"
211 runs-on: ubuntu-latest
212 steps:
213 - name: Checkout project
214 uses: actions/checkout@v4
215
216 - name: Setup Bun
217 uses: oven-sh/setup-bun@v2
218 with:
219 bun-version: latest
220
221 - name: Install client dependencies
222 working-directory: client
223 run: bun install
224
225 - name: Build client
226 working-directory: client
227 run: bun run build
228
229 - name: Move build folder
230 run: mv client/build .
231
232 - name: Install server dependencies
233 run: bun install
234
235 - name: Generate migrations
236 run: bun run generate-migrations
237
238 - name: Generate integrations
239 run: bun run generate-integrations
240
241 - name: Create zip archive
242 run: zip -r Pixies.zip build server package.json
243
244 - name: Upload to Release
245 uses: actions/github-script@v7
246 with:
247 script: |
248 const fs = require('fs');
249 await github.rest.repos.uploadReleaseAsset({
250 owner: context.repo.owner,
251 repo: context.repo.repo,
252 release_id: ${{ inputs.release_id }},
253 name: 'Pixies.zip',
254 data: fs.readFileSync('Pixies.zip')
255 });
256