-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (109 loc) · 4.17 KB
/
Copy pathrelease.yml
File metadata and controls
130 lines (109 loc) · 4.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
metrics:
name: Collect metrics
uses: anolishq/.github/.github/workflows/metrics.yml@c76784aff711e6540d539f6a5c3ea33c63627930 # v2
with:
tag: ${{ github.ref_name }}
release-linux-x86_64:
name: Release (linux-x86_64)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build g++ jq
- name: Extract version
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
cache-dependency-glob: |
pyproject.toml
uv.lock
- name: Install Python dependencies
run: uv sync --locked --extra dev
- name: Setup vcpkg
uses: anolishq/.github/.github/actions/setup-vcpkg@a9b3d134acbcc7dcd6da02c1a345a1fbdca15064 # v2.4
with:
triplet: x64-linux
- name: Configure
# Point CMake/ctest at the uv-managed venv so the integration.pytest
# test (run by ctest) can import pytest + the generated bindings,
# matching the CI server job.
run: cmake --preset ci-linux-release-server -DPython3_EXECUTABLE=$(pwd)/.venv/bin/python
- name: Build
run: cmake --build --preset ci-linux-release-server --parallel
- name: Test
run: ctest --preset ci-linux-release-server
- name: Package binary artifact
id: package
run: |
VERSION="${{ steps.version.outputs.version }}"
ARTIFACT="fluxgraph-${VERSION}-linux-x86_64.tar.gz"
BINARY="build-server/server/fluxgraph-server"
if [ ! -f "${BINARY}" ]; then
echo "ERROR: binary not found at ${BINARY}" >&2
exit 1
fi
mkdir -p staging/bin
cp "${BINARY}" staging/bin/
tar -czf "${ARTIFACT}" -C staging .
echo "artifact=${ARTIFACT}" >> "$GITHUB_OUTPUT"
- name: Package source tarball
run: |
VERSION="${{ steps.version.outputs.version }}"
git archive --format=tar.gz \
--prefix="fluxgraph-${VERSION}/" \
-o "fluxgraph-${VERSION}-source.tar.gz" \
HEAD
- name: Generate checksums
run: sha256sum fluxgraph-*.tar.gz > SHA256SUMS
- name: Generate manifest
run: |
VERSION="${{ steps.version.outputs.version }}"
ARTIFACT="${{ steps.package.outputs.artifact }}"
SHA=$(grep "${ARTIFACT}" SHA256SUMS | awk '{print $1}')
jq -n \
--argjson schema_version 1 \
--arg repo "anolishq/fluxgraph" \
--arg component "fluxgraph" \
--arg version "${VERSION}" \
--arg platform "linux-x86_64" \
--arg asset "${ARTIFACT}" \
--arg sha256 "${SHA}" \
'{schema_version: $schema_version, repo: $repo, component: $component, version: $version, platform: $platform, asset: $asset, sha256: $sha256}' \
> manifest.json
- name: Create GitHub release
uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3
with:
files: |
fluxgraph-*.tar.gz
SHA256SUMS
manifest.json
generate_release_notes: true
upload-metrics:
name: Upload metrics to release
runs-on: ubuntu-24.04
needs: [release-linux-x86_64, metrics]
steps:
- name: Download metrics artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: metrics-${{ github.event.repository.name }}-${{ github.run_number }}
path: metrics-out/
- name: Upload metrics.json to release
uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3
with:
files: metrics-out/metrics.json