Skip to content

Commit 9269788

Browse files
committed
ci: add GitHub Actions for tests and tagged releases
1 parent da8c312 commit 9269788

3 files changed

Lines changed: 64 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
strategy:
11+
matrix:
12+
os: [ubuntu-latest, macos-latest, windows-latest]
13+
runs-on: ${{ matrix.os }}
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Install dependencies (Linux)
17+
if: runner.os == 'Linux'
18+
run: sudo apt-get update && sudo apt-get install -y libssl-dev libcurl4-openssl-dev
19+
- name: Install dependencies (macOS)
20+
if: runner.os == 'macOS'
21+
run: brew install openssl curl
22+
- name: Install dependencies (Windows)
23+
if: runner.os == 'Windows'
24+
run: vcpkg install openssl curl
25+
- name: Configure
26+
run: cmake -S . -B build -DAUTHFORGE_BUILD_VECTOR_GENERATOR=OFF
27+
- name: Build
28+
run: cmake --build build --config Release

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Verify tag matches CMakeLists version
15+
run: |
16+
TAG="${GITHUB_REF#refs/tags/v}"
17+
CMAKE=$(grep -oP 'VERSION \K[0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt | head -1)
18+
if [ "$TAG" != "$CMAKE" ]; then
19+
echo "Tag v$TAG does not match CMakeLists.txt version $CMAKE"
20+
exit 1
21+
fi
22+
- name: Create source archive
23+
run: |
24+
TAG="${GITHUB_REF#refs/tags/}"
25+
git archive --format=tar.gz --prefix=authforge-cpp-${TAG}/ -o authforge-cpp-${TAG}.tar.gz HEAD
26+
- name: Create GitHub Release
27+
uses: softprops/action-gh-release@v2
28+
with:
29+
files: authforge-cpp-*.tar.gz
30+
generate_release_notes: true

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build/
2+
build-*/
23
cmake-build-*/
34
*.o
45
*.obj
@@ -8,4 +9,8 @@ cmake-build-*/
89
*.out
910
.vs/
1011
CMakeCache.txt
11-
CMakeFiles/
12+
CMakeFiles/
13+
14+
# Debug symbols / IDE
15+
*.pdb
16+
.idea/

0 commit comments

Comments
 (0)