Skip to content

Commit 7ad0fc1

Browse files
authored
Merge pull request #13 from chinwobble/release
add release workflow to publish binaries
2 parents 8c74771 + e48573c commit 7ad0fc1

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
- name: install build dependencies (Ubuntu)
23+
run: sudo apt update && sudo apt install -y libisal-dev
24+
if: runner.os == 'Linux'
25+
- name: install build dependencies (MacOS)
26+
run: brew install isa-l
27+
if: runner.os == 'macOS'
28+
29+
# 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.
30+
- uses: lukka/get-cmake@latest
31+
- name: Restore from cache the dependencies and generate project files
32+
run: |
33+
cmake --preset ninja-multi-vcpkg
34+
35+
- name: Build (Release configuration)
36+
run: |
37+
cmake --build --preset ninja-vcpkg-release
38+
39+
# Test the whole project with CTest, again Release configuration only.
40+
- name: Test (Release configuration)
41+
run: |
42+
ctest --preset test-release
43+
- name: release
44+
run: |
45+
set -x
46+
TAG_NAME=${{ github.ref }}
47+
TAG_NAME=${TAG_NAME#refs/tags/}
48+
49+
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
50+
FILE=fastplong_${OS}_$(arch)
51+
gh release create $TAG_NAME || :
52+
cp builds/ninja-multi-vcpkg/Release/fastplong $FILE
53+
gh release upload $TAG_NAME $FILE

0 commit comments

Comments
 (0)