Skip to content

Commit 828a8c4

Browse files
committed
chore: add release infrastructure and switch to Apache-2.0
- Add version macros to zap.h (0.3.0) - Switch license from LGPL-3.0/MIT to Apache-2.0 - Add git-cliff config for changelog generation - Add release workflow with GitHub Release, rattler-build, and prefix.dev - Add rattler-build recipe for prefix.dev packaging - Update README badges and license - Ignore markdown files (except README) and .claude directory
1 parent d0c4588 commit 828a8c4

File tree

10 files changed

+403
-358
lines changed

10 files changed

+403
-358
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: ci
22

33
on:
44
push:

.github/workflows/release.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: release
2+
run-name: release ${{ github.ref_name }}
3+
4+
on:
5+
push:
6+
tags:
7+
- "v*"
8+
9+
permissions:
10+
contents: write
11+
pull-requests: read
12+
13+
jobs:
14+
test:
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest, macos-latest]
18+
compiler: [gcc, clang]
19+
runs-on: ${{ matrix.os }}
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Build examples
23+
run: make all CC=${{ matrix.compiler }}
24+
- name: Run tests
25+
run: make test CC=${{ matrix.compiler }}
26+
27+
release:
28+
name: GitHub Release
29+
needs: [test]
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
- name: Verify version matches tag
36+
run: |
37+
TAG="${GITHUB_REF_NAME#v}"
38+
HEADER=$(grep '#define ZAP_VERSION "' zap.h | sed 's/.*"\(.*\)"/\1/')
39+
if [ "$TAG" != "$HEADER" ]; then
40+
echo "::error::Tag $GITHUB_REF_NAME does not match zap.h version \"$HEADER\""
41+
exit 1
42+
fi
43+
- uses: orhun/git-cliff-action@v4
44+
id: changelog
45+
with:
46+
args: --latest
47+
- name: Generate release notes
48+
run: echo "${{ steps.changelog.outputs.content }}" | tail -n +2 > RELEASE_NOTES.md
49+
- uses: softprops/action-gh-release@v2
50+
with:
51+
name: ${{ github.ref_name }}
52+
body_path: RELEASE_NOTES.md
53+
files: zap.h
54+
55+
build-package:
56+
name: Build conda package
57+
needs: [release]
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v4
61+
- name: Compute archive sha256
62+
run: |
63+
TAG="${GITHUB_REF_NAME}"
64+
URL="https://github.com/alvgaona/zap/archive/${TAG}.tar.gz"
65+
SHA=$(curl -sL "$URL" | sha256sum | cut -d' ' -f1)
66+
echo "ARCHIVE_SHA256=${SHA}" >> "$GITHUB_ENV"
67+
- uses: prefix-dev/rattler-build-action@v0.2.36
68+
with:
69+
recipe-path: recipe.yaml
70+
upload-artifact: true
71+
72+
publish:
73+
name: Publish to prefix.dev
74+
needs: [build-package]
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: prefix-dev/rattler-build-action@v0.2.36
78+
with:
79+
build-args: --help
80+
setup-only: true
81+
- uses: actions/download-artifact@v4
82+
with:
83+
path: packages
84+
- name: Upload to prefix.dev
85+
run: |
86+
find packages -name '*.conda' -exec \
87+
rattler-build upload prefix -c zap {} \;
88+
env:
89+
PREFIX_API_KEY: ${{ secrets.PREFIX_DEV_API_KEY }}

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,11 @@
22

33
# C
44
build/
5-
CLAUDE.md
5+
output/
6+
7+
# Markdown (except README)
8+
*.md
9+
!README.md
10+
11+
# Claude
12+
.claude/

CHANGELOG.md

Lines changed: 0 additions & 125 deletions
This file was deleted.

0 commit comments

Comments
 (0)