File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : release
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*'
7+
8+ permissions :
9+ contents : write
10+
11+ jobs :
12+ build-and-release :
13+ strategy :
14+ matrix :
15+ os : [ubuntu-latest, windows-latest, macos-latest]
16+ include :
17+ - os : ubuntu-latest
18+ artifact_name : vark
19+ suffix : linux
20+ - os : windows-latest
21+ artifact_name : vark.exe
22+ suffix : windows
23+ - os : macos-latest
24+ artifact_name : vark
25+ suffix : macos
26+
27+ runs-on : ${{ matrix.os }}
28+
29+ steps :
30+ - uses : actions/checkout@v4
31+
32+ - name : Configure CMake
33+ run : cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
34+
35+ - name : Build
36+ run : cmake --build build --config Release
37+
38+ - name : Run Tests
39+ run : ctest --test-dir build -C Release --output-on-failure
40+
41+ - name : Package (Unix)
42+ if : runner.os != 'Windows'
43+ run : |
44+ cd build
45+ zip ../vark-${{ matrix.suffix }}-${{ github.ref_name }}.zip ${{ matrix.artifact_name }}
46+
47+ - name : Package (Windows)
48+ if : runner.os == 'Windows'
49+ shell : pwsh
50+ run : |
51+ # Handle cases where multi-config generators (like VS) put the binary in a 'Release' subfolder
52+ $binPath = "build/${{ matrix.artifact_name }}"
53+ if (!(Test-Path $binPath)) { $binPath = "build/Release/${{ matrix.artifact_name }}" }
54+ Compress-Archive -Path $binPath -DestinationPath "vark-${{ matrix.suffix }}-${{ github.ref_name }}.zip"
55+
56+ - name : Upload Release
57+ uses : softprops/action-gh-release@v2
58+ with :
59+ files : vark-${{ matrix.suffix }}-${{ github.ref_name }}.zip
60+ env :
61+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments