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
name: Release
# Build the polyglotmesh binary on every push to a tag matching v*.*.*
# and attach the resulting tarball to a fresh GitHub release.
#
# Single-job workflow (no cross-job artifact passing) — simpler and
# avoids the v4 download-artifact / softprops-action-gh-release file
# path gotcha.
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
permissions:
contents: write
jobs:
release:
name: Build + release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-release-${{ hashFiles('Cargo.lock') }}
- name: Build
run: cargo build --release --bin polyglotmesh
- name: Package
run: |
mkdir -p release-artifacts
cd target/release
tar -cJf ../../release-artifacts/polyglotmesh-x86_64-unknown-linux-gnu.tar.xz polyglotmesh
cd ../../release-artifacts
sha256sum polyglotmesh-x86_64-unknown-linux-gnu.tar.xz > SHA256SUMS
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
name: polyglotmesh ${{ github.ref_name }}
body: ${{ github.event.release.body || 'See CHANGELOG.md for details.' }}
files: |
release-artifacts/polyglotmesh-x86_64-unknown-linux-gnu.tar.xz
release-artifacts/SHA256SUMS
generate_release_notes: true
fail_on_unmatched_files: true