Skip to content

Commit af288aa

Browse files
benneybenney
authored andcommitted
add release workflow to publish binaries
1 parent 2fb8ecc commit af288aa

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: release
2+
on:
3+
push:
4+
tags:
5+
- v[0-9]+.[0-9]+.[0-9]+
6+
7+
jobs:
8+
job:
9+
name: ${{ matrix.os }}-${{ github.workflow }}
10+
env:
11+
GH_TOKEN: ${{ github.token }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-24.04, macos-13, macos-15]
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
submodules: true
21+
22+
# Setup the build machine with the most recent versions of CMake and Ninja. Both are cached if not already: on subsequent runs both will be quickly restored from GitHub cache service.
23+
- uses: lukka/get-cmake@latest
24+
- name: Restore from cache the dependencies and generate project files
25+
run: |
26+
cmake --preset ninja-multi-vcpkg
27+
28+
- name: Build (Release configuration)
29+
run: |
30+
cmake --build --preset ninja-vcpkg-release
31+
32+
# Test the whole project with CTest, again Release configuration only.
33+
- name: Test (Release configuration)
34+
run: |
35+
ctest --preset test-release
36+
- name: release
37+
run: |
38+
set -x
39+
TAG_NAME=${{ github.ref }}
40+
TAG_NAME=${TAG_NAME#refs/tags/}
41+
42+
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
43+
FILE=fastplong_${OS}_$(arch)
44+
gh release create $TAG_NAME || :
45+
cp builds/ninja-multi-vcpkg/Release/fastplong $FILE
46+
gh release upload $TAG_NAME $FILE

0 commit comments

Comments
 (0)