Repository navigation
797 lines (670 loc) · 27.5 KB
/
Copy pathrelease.yml
File metadata and controls
797 lines (670 loc) · 27.5 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
# Release Build & Distribution Workflow
# Builds release binaries and packages for all platforms
name: Release Build
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g., 1.0.0)'
required: true
default: '1.0.0'
prerelease:
description: 'Mark as pre-release'
required: false
default: 'false'
type: boolean
env:
BUILD_TYPE: Release
VERSION: ${{ github.event.inputs.version || github.ref_name }}
jobs:
# ============================================
# Version Preparation
# ============================================
prepare:
name: Prepare Release
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
is_prerelease: ${{ steps.version.outputs.is_prerelease }}
steps:
- uses: actions/checkout@v4
- name: Determine version
id: version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ github.event.inputs.version }}"
IS_PRERELEASE="${{ github.event.inputs.prerelease }}"
else
VERSION="${GITHUB_REF_NAME#v}"
if [[ "$VERSION" == *"-"* ]]; then
IS_PRERELEASE="true"
else
IS_PRERELEASE="false"
fi
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "is_prerelease=$IS_PRERELEASE" >> "$GITHUB_OUTPUT"
echo "Release version: $VERSION (prerelease: $IS_PRERELEASE)"
# ============================================
# Linux Release Builds
# ============================================
linux-release:
name: Linux Release (${{ matrix.arch }})
runs-on: ubuntu-latest
needs: prepare
strategy:
fail-fast: false
matrix:
arch: [x64]
include:
- arch: x64
triplet: x64-linux
cc: gcc-13
cxx: g++-13
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential ninja-build pkg-config \
libcurl4-openssl-dev libjsoncpp-dev libglfw3-dev \
libgl1-mesa-dev libglu1-mesa-dev libssl-dev zlib1g-dev \
libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev \
gcc-13 g++-13 \
patchelf chrpath
- name: Setup vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git ~/vcpkg
~/vcpkg/bootstrap-vcpkg.sh
- name: Configure CMake
run: |
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=${{ matrix.cc }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
"-DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake" \
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_SHARED_LIBS=OFF
- name: Build
run: cmake --build build --config Release -j "$(nproc)"
- name: Run tests
working-directory: build
run: |
export LD_LIBRARY_PATH="${PWD}:$LD_LIBRARY_PATH"
ctest --output-on-failure --timeout 120 || true
- name: Create release package
run: |
mkdir -p release/bolt-${{ needs.prepare.outputs.version }}-linux-${{ matrix.arch }}
cp build/bolt release/bolt-${{ needs.prepare.outputs.version }}-linux-${{ matrix.arch }}/
cp build/bolt_lib* release/bolt-${{ needs.prepare.outputs.version }}-linux-${{ matrix.arch }}/ 2>/dev/null || true
cp -r build/demo_* release/bolt-${{ needs.prepare.outputs.version }}-linux-${{ matrix.arch }}/ 2>/dev/null || true
# Copy documentation
cp README.md LICENSE* release/bolt-${{ needs.prepare.outputs.version }}-linux-${{ matrix.arch }}/ 2>/dev/null || true
# Create tarball
cd release
tar -czvf bolt-${{ needs.prepare.outputs.version }}-linux-${{ matrix.arch }}.tar.gz \
bolt-${{ needs.prepare.outputs.version }}-linux-${{ matrix.arch }}
# Create checksum
sha256sum bolt-${{ needs.prepare.outputs.version }}-linux-${{ matrix.arch }}.tar.gz > \
bolt-${{ needs.prepare.outputs.version }}-linux-${{ matrix.arch }}.tar.gz.sha256
- name: Upload release artifacts
uses: actions/upload-artifact@v4
with:
name: bolt-linux-${{ matrix.arch }}-release
path: |
release/bolt-${{ needs.prepare.outputs.version }}-linux-${{ matrix.arch }}.tar.gz
release/bolt-${{ needs.prepare.outputs.version }}-linux-${{ matrix.arch }}.tar.gz.sha256
retention-days: 30
# ============================================
# Linux Package Builds (DEB, RPM)
# ============================================
linux-packages:
name: Linux Packages
runs-on: ubuntu-latest
needs: [prepare, linux-release]
steps:
- uses: actions/checkout@v4
- name: Install packaging dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential ninja-build pkg-config \
libcurl4-openssl-dev libjsoncpp-dev libglfw3-dev \
libgl1-mesa-dev libssl-dev zlib1g-dev \
gcc-13 g++-13 \
dpkg-dev debhelper fakeroot rpm rpmlint
- name: Configure and Build
run: |
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=gcc-13 \
-DCMAKE_CXX_COMPILER=g++-13 \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_SHARED_LIBS=OFF
cmake --build build -j "$(nproc)"
- name: Create DEB package
run: |
VERSION="${{ needs.prepare.outputs.version }}"
PKGDIR="bolt_${VERSION}_amd64"
mkdir -p "$PKGDIR/DEBIAN"
mkdir -p "$PKGDIR/usr/bin"
mkdir -p "$PKGDIR/usr/lib"
mkdir -p "$PKGDIR/usr/share/doc/bolt"
mkdir -p "$PKGDIR/usr/share/applications"
# Copy binaries
cp build/bolt "$PKGDIR/usr/bin/"
cp build/bolt_lib* "$PKGDIR/usr/lib/" 2>/dev/null || true
# Work out the runtime dependencies from the libraries the binary
# actually links, so the package installs what bolt needs on a
# clean machine. Fall back to a fixed list if that is not possible.
mkdir -p debian && touch debian/control
DEPENDS="$(dpkg-shlibdeps -O build/bolt 2>/dev/null | sed -n 's/^shlibs:Depends=//p')"
rm -rf debian
if [ -z "$DEPENDS" ]; then
DEPENDS="libc6 (>= 2.31), libstdc++6 (>= 10), libcurl4, libssl3, zlib1g"
fi
echo "Package dependencies: $DEPENDS"
# Create control file
cat > "$PKGDIR/DEBIAN/control" << EOF
Package: bolt
Version: ${VERSION}
Section: devel
Priority: optional
Architecture: amd64
Depends: ${DEPENDS}
Maintainer: Bolt Development Team <bolt@example.com>
Description: Bolt C++ ML IDE
A modern C++ implementation of the Bolt IDE core components
with AI integration, LSP support, and real-time collaborative features.
EOF
# Build package. dpkg-deb names the output after the directory,
# which is already bolt_<version>_amd64.deb.
dpkg-deb --root-owner-group --build "$PKGDIR"
# Verify package metadata
dpkg -I "bolt_${VERSION}_amd64.deb"
- name: Install and run the DEB package
run: |
VERSION="${{ needs.prepare.outputs.version }}"
sudo dpkg -i "bolt_${VERSION}_amd64.deb"
/usr/bin/bolt --version
printf 'hello\n/exit\n' | /usr/bin/bolt | grep -q 'Echo: hello'
sudo dpkg -r bolt
- name: Create RPM package
run: |
VERSION="${{ needs.prepare.outputs.version }}"
mkdir -p rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
# Create tarball for RPM
mkdir -p bolt-${VERSION}
cp -r build/bolt bolt-${VERSION}/
cp build/bolt_lib* bolt-${VERSION}/ 2>/dev/null || true
tar -czvf rpmbuild/SOURCES/bolt-${VERSION}.tar.gz bolt-${VERSION}
# Create spec file
cat > rpmbuild/SPECS/bolt.spec << 'EOF'
# The binary is prebuilt; skip the debuginfo subpackage, which needs
# elfutils (eu-strip) and is not installed on the runner.
%global debug_package %{nil}
Name: bolt
Version: ${{ needs.prepare.outputs.version }}
Release: 1%{?dist}
Summary: Bolt C++ ML IDE
License: MIT
Source0: bolt-%{version}.tar.gz
BuildRequires: gcc-c++, cmake, ninja-build
Requires: libcurl, openssl, zlib
%description
A modern C++ implementation of the Bolt IDE core components
with AI integration, LSP support, and real-time collaborative features.
%prep
%setup -q
%install
mkdir -p %{buildroot}/usr/bin
cp bolt %{buildroot}/usr/bin/
%files
/usr/bin/bolt
%changelog
* CHANGELOG_DATE Bolt Team <bolt@example.com> - ${{ needs.prepare.outputs.version }}-1
- Initial release
EOF
# The heredoc above is quoted so that rpm macros stay literal,
# which also means $(date) would not expand; fill the date in here.
sed -i "s/CHANGELOG_DATE/$(LC_ALL=C date +'%a %b %d %Y')/" rpmbuild/SPECS/bolt.spec
# Build RPM. --nodeps: the BuildRequires are RPM package names and
# cannot be checked against the rpm database on an Ubuntu runner;
# the binary was already built above.
rpmbuild --nodeps --define "_topdir $(pwd)/rpmbuild" -bb rpmbuild/SPECS/bolt.spec
ls -l rpmbuild/RPMS/*/*.rpm
- name: Upload packages
uses: actions/upload-artifact@v4
with:
name: bolt-linux-packages
path: |
bolt_*.deb
rpmbuild/RPMS/**/*.rpm
retention-days: 30
if-no-files-found: warn
# ============================================
# Windows Release Builds
# ============================================
windows-release:
name: Windows Release (${{ matrix.compiler }})
runs-on: windows-latest
needs: prepare
strategy:
fail-fast: false
matrix:
compiler: [msvc]
include:
- compiler: msvc
# windows-latest has Visual Studio 2026 (product line 18) and
# CMake 3.31, which has no "Visual Studio 18 2026" generator.
# "Visual Studio 17 2022" fails with "could not find any instance
# of Visual Studio". Ninja uses cl.exe from the MSVC developer
# environment and matches the Linux/macOS release jobs.
generator: Ninja
steps:
- uses: actions/checkout@v4
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Setup vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git C:\vcpkg
C:\vcpkg\bootstrap-vcpkg.bat
- name: Configure CMake
run: |
cmake -B build -G "${{ matrix.generator }}" `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_C_COMPILER=cl `
-DCMAKE_CXX_COMPILER=cl `
-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake `
-DVCPKG_TARGET_TRIPLET=x64-windows `
-DBUILD_SHARED_LIBS=OFF
- name: Build
run: cmake --build build --config Release -j $env:NUMBER_OF_PROCESSORS
- name: Run tests
working-directory: build
run: ctest --output-on-failure --timeout 120
continue-on-error: true
- name: Create release package
shell: powershell
run: |
$VERSION = "${{ needs.prepare.outputs.version }}"
$PKGDIR = "bolt-$VERSION-windows-x64"
New-Item -ItemType Directory -Force -Path $PKGDIR
# Ninja writes binaries to build\; multi-config generators use build\Release\.
$binDir = @("build", "build\Release") | Where-Object { Test-Path (Join-Path $_ "bolt.exe") } | Select-Object -First 1
if (-not $binDir) {
throw "bolt.exe was not produced (looked in build\ and build\Release\)"
}
Copy-Item -Path (Join-Path $binDir "bolt.exe") -Destination $PKGDIR
Copy-Item -Path (Join-Path $binDir "bolt*.dll") -Destination $PKGDIR -ErrorAction SilentlyContinue
Copy-Item -Path (Join-Path $binDir "demo_*.exe") -Destination $PKGDIR -ErrorAction SilentlyContinue
# Copy the dependency DLLs from vcpkg. The project uses a vcpkg
# manifest, so they are installed under the build tree; classic
# mode would put them under C:\vcpkg\installed.
$vcpkgBin = @("build\vcpkg_installed\x64-windows\bin", "C:\vcpkg\installed\x64-windows\bin") |
Where-Object { Test-Path $_ } | Select-Object -First 1
if (-not $vcpkgBin) {
throw "vcpkg runtime DLL directory not found; the package would not run without its DLLs"
}
Get-ChildItem -Path (Join-Path $vcpkgBin "*.dll") | Copy-Item -Destination $PKGDIR
# Copy documentation
Copy-Item -Path "README.md" -Destination $PKGDIR -ErrorAction SilentlyContinue
# Create ZIP
Compress-Archive -Path $PKGDIR -DestinationPath "bolt-$VERSION-windows-x64.zip"
# Create checksum
$hash = Get-FileHash "bolt-$VERSION-windows-x64.zip" -Algorithm SHA256
"$($hash.Hash) bolt-$VERSION-windows-x64.zip" | Out-File -FilePath "bolt-$VERSION-windows-x64.zip.sha256" -Encoding ASCII
- name: Upload release artifacts
uses: actions/upload-artifact@v4
with:
name: bolt-windows-x64-release
path: |
bolt-${{ needs.prepare.outputs.version }}-windows-x64.zip
bolt-${{ needs.prepare.outputs.version }}-windows-x64.zip.sha256
retention-days: 30
# ============================================
# Windows Installer (MSI)
# ============================================
windows-installer:
name: Windows Installer
runs-on: windows-latest
needs: [prepare, windows-release]
steps:
- uses: actions/checkout@v4
- name: Download Windows build
uses: actions/download-artifact@v4
with:
name: bolt-windows-x64-release
path: release/
- name: Extract release
shell: powershell
run: |
Expand-Archive -Path "release\bolt-${{ needs.prepare.outputs.version }}-windows-x64.zip" -DestinationPath "extracted\"
- name: Install WiX Toolset
run: |
choco install wixtoolset -y
- name: Create WiX source
shell: powershell
run: |
$VERSION = "${{ needs.prepare.outputs.version }}"
@"
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Bolt C++ ML IDE" Language="1033"
Version="$VERSION" Manufacturer="Bolt Team"
UpgradeCode="12345678-1234-1234-1234-123456789012">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"/>
<MajorUpgrade DowngradeErrorMessage="A newer version is already installed."/>
<MediaTemplate EmbedCab="yes"/>
<Feature Id="ProductFeature" Title="Bolt" Level="1">
<ComponentGroupRef Id="ProductComponents"/>
</Feature>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="INSTALLFOLDER" Name="Bolt"/>
</Directory>
</Directory>
</Product>
</Wix>
"@ | Out-File -FilePath "bolt.wxs" -Encoding UTF8
- name: Build MSI
shell: powershell
run: |
$VERSION = "${{ needs.prepare.outputs.version }}"
$SRC = "extracted\bolt-$VERSION-windows-x64"
# Locate WiX through the WIX variable its installer sets rather
# than a hard-coded version directory (the runner image moves on).
$wixBin = if ($env:WIX) { Join-Path $env:WIX "bin" } else { Split-Path (Get-Command candle.exe).Source }
# Harvest every file of the release (bolt.exe and the DLLs it
# needs) into the ProductComponents group referenced by bolt.wxs.
& (Join-Path $wixBin "heat.exe") dir $SRC -cg ProductComponents -dr INSTALLFOLDER `
-gg -sfrag -srd -sreg -var var.SourceDir -out files.wxs
if ($LASTEXITCODE -ne 0) { throw "heat.exe failed" }
& (Join-Path $wixBin "candle.exe") -arch x64 "-dSourceDir=$SRC" bolt.wxs files.wxs
if ($LASTEXITCODE -ne 0) { throw "candle.exe failed" }
& (Join-Path $wixBin "light.exe") -out "bolt-$VERSION-windows-x64.msi" bolt.wixobj files.wixobj
if ($LASTEXITCODE -ne 0) { throw "light.exe failed" }
- name: Upload MSI
uses: actions/upload-artifact@v4
if: success()
with:
name: bolt-windows-msi
path: bolt-*.msi
retention-days: 30
if-no-files-found: warn
# ============================================
# macOS Release Builds
# ============================================
macos-release:
name: macOS Release (${{ matrix.arch }})
runs-on: ${{ matrix.runner }}
needs: prepare
# macOS is temporarily disabled while the Windows and Linux builds are stabilised.
# Remove this line (and the ones on macos-universal and macos-dmg) and
# restore the macOS entries in create-release to re-enable.
if: false
strategy:
fail-fast: false
matrix:
include:
- runner: macos-15-intel
arch: x64
triplet: x64-osx
- runner: macos-15
arch: arm64
triplet: arm64-osx
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install ninja pkg-config curl jsoncpp glfw openssl@3 zlib
- name: Setup vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git ~/vcpkg
~/vcpkg/bootstrap-vcpkg.sh
- name: Configure CMake
run: |
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
"-DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake" \
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} \
-DBUILD_SHARED_LIBS=OFF
- name: Build
run: cmake --build build --config Release -j "$(sysctl -n hw.ncpu)"
- name: Run tests
working-directory: build
run: ctest --output-on-failure --timeout 120
continue-on-error: true
- name: Create release package
run: |
VERSION="${{ needs.prepare.outputs.version }}"
PKGDIR="bolt-${VERSION}-macos-${{ matrix.arch }}"
mkdir -p "$PKGDIR"
cp build/bolt "$PKGDIR/"
cp build/bolt_lib* "$PKGDIR/" 2>/dev/null || true
cp build/demo_* "$PKGDIR/" 2>/dev/null || true
cp README.md "$PKGDIR/" 2>/dev/null || true
# Create tarball
tar -czvf "bolt-${VERSION}-macos-${{ matrix.arch }}.tar.gz" "$PKGDIR"
# Create checksum
shasum -a 256 "bolt-${VERSION}-macos-${{ matrix.arch }}.tar.gz" > \
"bolt-${VERSION}-macos-${{ matrix.arch }}.tar.gz.sha256"
- name: Upload release artifacts
uses: actions/upload-artifact@v4
with:
name: bolt-macos-${{ matrix.arch }}-release
path: |
bolt-${{ needs.prepare.outputs.version }}-macos-${{ matrix.arch }}.tar.gz
bolt-${{ needs.prepare.outputs.version }}-macos-${{ matrix.arch }}.tar.gz.sha256
retention-days: 30
# ============================================
# macOS Universal Binary
# ============================================
macos-universal:
name: macOS Universal Binary
runs-on: macos-15
needs: [prepare, macos-release]
if: false # macOS temporarily disabled, see macos-release
steps:
- name: Download x64 build
uses: actions/download-artifact@v4
with:
name: bolt-macos-x64-release
path: x64/
- name: Download arm64 build
uses: actions/download-artifact@v4
with:
name: bolt-macos-arm64-release
path: arm64/
- name: Create universal binary
run: |
VERSION="${{ needs.prepare.outputs.version }}"
# Extract both architectures
tar -xzf "x64/bolt-${VERSION}-macos-x64.tar.gz"
mv "bolt-${VERSION}-macos-x64" x64-bin
tar -xzf "arm64/bolt-${VERSION}-macos-arm64.tar.gz"
mv "bolt-${VERSION}-macos-arm64" arm64-bin
# Create universal binary
mkdir -p "bolt-${VERSION}-macos-universal"
lipo -create -output "bolt-${VERSION}-macos-universal/bolt" \
x64-bin/bolt arm64-bin/bolt
# Verify
file "bolt-${VERSION}-macos-universal/bolt"
# Package
tar -czvf "bolt-${VERSION}-macos-universal.tar.gz" "bolt-${VERSION}-macos-universal"
shasum -a 256 "bolt-${VERSION}-macos-universal.tar.gz" > \
"bolt-${VERSION}-macos-universal.tar.gz.sha256"
- name: Upload universal binary
uses: actions/upload-artifact@v4
with:
name: bolt-macos-universal-release
path: |
bolt-${{ needs.prepare.outputs.version }}-macos-universal.tar.gz
bolt-${{ needs.prepare.outputs.version }}-macos-universal.tar.gz.sha256
retention-days: 30
# ============================================
# macOS DMG Installer
# ============================================
macos-dmg:
name: macOS DMG Installer
runs-on: macos-15
needs: [prepare, macos-universal]
if: false # macOS temporarily disabled, see macos-release
steps:
- uses: actions/checkout@v4
- name: Download universal binary
uses: actions/download-artifact@v4
with:
name: bolt-macos-universal-release
path: release/
- name: Create DMG
run: |
VERSION="${{ needs.prepare.outputs.version }}"
# Extract universal binary
tar -xzf "release/bolt-${VERSION}-macos-universal.tar.gz"
# Create app bundle structure
mkdir -p "Bolt.app/Contents/MacOS"
mkdir -p "Bolt.app/Contents/Resources"
cp "bolt-${VERSION}-macos-universal/bolt" "Bolt.app/Contents/MacOS/"
# Create Info.plist
cat > "Bolt.app/Contents/Info.plist" << EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>bolt</string>
<key>CFBundleIdentifier</key>
<string>com.bolt.ide</string>
<key>CFBundleName</key>
<string>Bolt</string>
<key>CFBundleVersion</key>
<string>${VERSION}</string>
<key>CFBundleShortVersionString</key>
<string>${VERSION}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>LSMinimumSystemVersion</key>
<string>11.0</string>
</dict>
</plist>
EOF
# Create DMG staging
mkdir -p dmg_staging
mv "Bolt.app" dmg_staging/
ln -s /Applications dmg_staging/Applications
# Create DMG
hdiutil create -volname "Bolt $VERSION" \
-srcfolder dmg_staging \
-ov -format UDZO \
"bolt-${VERSION}-macos.dmg"
# Create checksum
shasum -a 256 "bolt-${VERSION}-macos.dmg" > "bolt-${VERSION}-macos.dmg.sha256"
- name: Upload DMG
uses: actions/upload-artifact@v4
with:
name: bolt-macos-dmg
path: |
bolt-${{ needs.prepare.outputs.version }}-macos.dmg
bolt-${{ needs.prepare.outputs.version }}-macos.dmg.sha256
retention-days: 30
# ============================================
# Create GitHub Release
# ============================================
create-release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs:
- prepare
- linux-release
- linux-packages
- windows-release
- windows-installer
# macOS temporarily disabled. A skipped dependency would skip this
# job too, so the macOS jobs are left out of "needs" until then.
# - macos-release
# - macos-universal
# - macos-dmg
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
- name: Prepare release files
run: |
mkdir -p release-files
find artifacts -type f \( -name "*.tar.gz" -o -name "*.zip" -o -name "*.deb" \
-o -name "*.rpm" -o -name "*.msi" -o -name "*.dmg" -o -name "*.sha256" \) \
-exec cp {} release-files/ \;
ls -la release-files/
- name: Generate release notes
run: |
VERSION="${{ needs.prepare.outputs.version }}"
cat > release-notes.md << EOF
# Bolt C++ ML IDE v${VERSION}
## Downloads
### Linux
- \`bolt-${VERSION}-linux-x64.tar.gz\` - Linux x64 binary
- \`bolt_${VERSION}_amd64.deb\` - Debian/Ubuntu package
- \`bolt-${VERSION}-1.x86_64.rpm\` - Fedora/RHEL package
### Windows
- \`bolt-${VERSION}-windows-x64.zip\` - Windows x64 binary
- \`bolt-${VERSION}-windows-x64.msi\` - Windows installer
### macOS
macOS builds are temporarily unavailable.
## Checksums
SHA256 checksums are provided for all downloads in \`.sha256\` files.
## Installation
### Linux (DEB)
\`\`\`bash
sudo dpkg -i bolt_${VERSION}_amd64.deb
\`\`\`
### Linux (RPM)
\`\`\`bash
sudo rpm -i bolt-${VERSION}-1.x86_64.rpm
\`\`\`
### Windows
Run the MSI installer or extract the ZIP to your preferred location.
## What's Changed
See the full changelog for details.
EOF
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
name: Bolt v${{ needs.prepare.outputs.version }}
body_path: release-notes.md
prerelease: ${{ needs.prepare.outputs.is_prerelease }}
files: release-files/*
fail_on_unmatched_files: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# ============================================
# Notify on completion
# ============================================
notify:
name: Notify
runs-on: ubuntu-latest
needs: [prepare, create-release]
if: always()
steps:
- name: Release Summary
run: |
{
echo "## Release Summary"
echo ""
echo "Version: ${{ needs.prepare.outputs.version }}"
echo "Pre-release: ${{ needs.prepare.outputs.is_prerelease }}"
echo ""
echo "Publishing job: ${{ needs.create-release.result }}"
} >> "$GITHUB_STEP_SUMMARY"