Skip to content

Commit 19d644a

Browse files
feat: add release workflow
On v* tag, builds ci-linux-release-server preset (gRPC server with JSON+YAML), runs full CTest suite, packages fluxgraph-server binary + source tarball + manifest.json + SHA256SUMS, uploads to GitHub release.
1 parent 9b084b8 commit 19d644a

1 file changed

Lines changed: 107 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
env:
12+
VCPKG_COMMIT: "66c0373dc7fca549e5803087b9487edfe3aca0a1"
13+
14+
jobs:
15+
release-linux-x86_64:
16+
name: Release (linux-x86_64)
17+
runs-on: ubuntu-24.04
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Install system dependencies
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y ninja-build g++ jq
26+
27+
- name: Extract version
28+
id: version
29+
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
30+
31+
- name: Setup Python and dependencies
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: "3.12"
35+
cache: "pip"
36+
cache-dependency-path: requirements-lock.txt
37+
38+
- name: Install Python dependencies
39+
run: |
40+
python -m pip install --upgrade pip
41+
python -m pip install -r requirements-lock.txt
42+
43+
- name: Setup vcpkg
44+
uses: lukka/run-vcpkg@v11
45+
with:
46+
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }}
47+
doNotCache: false
48+
49+
- name: Configure
50+
run: cmake --preset ci-linux-release-server
51+
52+
- name: Build
53+
run: cmake --build --preset ci-linux-release-server --parallel
54+
55+
- name: Test
56+
run: ctest --preset ci-linux-release-server
57+
58+
- name: Package binary artifact
59+
id: package
60+
run: |
61+
VERSION="${{ steps.version.outputs.version }}"
62+
ARTIFACT="fluxgraph-${VERSION}-linux-x86_64.tar.gz"
63+
BINARY="build-server/server/fluxgraph-server"
64+
if [ ! -f "${BINARY}" ]; then
65+
echo "ERROR: binary not found at ${BINARY}" >&2
66+
exit 1
67+
fi
68+
mkdir -p staging/bin
69+
cp "${BINARY}" staging/bin/
70+
tar -czf "${ARTIFACT}" -C staging .
71+
echo "artifact=${ARTIFACT}" >> "$GITHUB_OUTPUT"
72+
73+
- name: Package source tarball
74+
run: |
75+
VERSION="${{ steps.version.outputs.version }}"
76+
git archive --format=tar.gz \
77+
--prefix="fluxgraph-${VERSION}/" \
78+
-o "fluxgraph-${VERSION}-source.tar.gz" \
79+
HEAD
80+
81+
- name: Generate checksums
82+
run: sha256sum fluxgraph-*.tar.gz > SHA256SUMS
83+
84+
- name: Generate manifest
85+
run: |
86+
VERSION="${{ steps.version.outputs.version }}"
87+
ARTIFACT="${{ steps.package.outputs.artifact }}"
88+
SHA=$(grep "${ARTIFACT}" SHA256SUMS | awk '{print $1}')
89+
jq -n \
90+
--argjson schema_version 1 \
91+
--arg repo "anolishq/fluxgraph" \
92+
--arg component "fluxgraph" \
93+
--arg version "${VERSION}" \
94+
--arg platform "linux-x86_64" \
95+
--arg asset "${ARTIFACT}" \
96+
--arg sha256 "${SHA}" \
97+
'{schema_version: $schema_version, repo: $repo, component: $component, version: $version, platform: $platform, asset: $asset, sha256: $sha256}' \
98+
> manifest.json
99+
100+
- name: Create GitHub release
101+
uses: softprops/action-gh-release@v2
102+
with:
103+
files: |
104+
fluxgraph-*.tar.gz
105+
SHA256SUMS
106+
manifest.json
107+
generate_release_notes: true

0 commit comments

Comments
 (0)