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
name: release
# Build precompiled faculty binaries on tag push and attach them to
# the GitHub release. Restricted sandboxes can grab a tarball; dev
# environments can still `cargo install` from source.
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
name: ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-24.04-arm
# Intel macOS dropped: Apple stopped shipping Intel Macs
# in late 2023 and the macos-13 free runner queue
# frequently times out before the build slot opens. Add
# back if a downstream user actually asks for it.
- target: aarch64-apple-darwin
os: macos-14
steps:
- uses: actions/checkout@v4
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
# `wasm32-unknown-unknown` is needed because `wasmi`'s build
# script (pulled transitively via triblespace-core 0.37)
# invokes rustc against it.
targets: ${{ matrix.target }}, wasm32-unknown-unknown
- name: Build all binaries
# Release builds don't deny warnings — that's a lint concern,
# and the CLI faculties carry pre-existing unused-import
# noise from their rust-script origins. Add a separate lint
# workflow if/when we want to enforce.
run: cargo build --release --bins --target ${{ matrix.target }}
- name: Build bundled trible CLI
# Ship the `trible` CLI alongside the faculty bins so users
# who grab a tarball get the whole pile-management toolkit
# in one drop. Pulled from crates.io (latest) and built for
# the matrix target via `cargo install`.
run: |
cargo install trible \
--target ${{ matrix.target }} \
--root "$RUNNER_TEMP/trible-staged" \
--locked
- name: Stage binaries
run: |
set -eu
stage="faculties-${GITHUB_REF_NAME}-${{ matrix.target }}"
mkdir -p "$stage"
cp LICENSE-MIT LICENSE-APACHE README.md "$stage/" || true
# All faculty binaries (extension-less; .exe suffix on windows
# if we ever add it). The widgets-only viewer is gated by a
# feature so it's not built by default in this workflow.
for bin in target/${{ matrix.target }}/release/*; do
[ -f "$bin" ] || continue
[ -x "$bin" ] || continue
case "$(basename "$bin")" in
*.d|*.rlib|*.so|*.dylib|deps|build|examples|incremental) continue ;;
esac
cp "$bin" "$stage/"
done
# Bundled trible CLI from the previous step.
cp "$RUNNER_TEMP/trible-staged/bin/trible" "$stage/"
tar -czf "$stage.tar.gz" "$stage"
shasum -a 256 "$stage.tar.gz" > "$stage.tar.gz.sha256"
echo "STAGE_TARBALL=$stage.tar.gz" >> "$GITHUB_ENV"
echo "STAGE_SHA256=$stage.tar.gz.sha256" >> "$GITHUB_ENV"
- name: Upload release assets
uses: softprops/action-gh-release@v2
with:
files: |
${{ env.STAGE_TARBALL }}
${{ env.STAGE_SHA256 }}
publish-meta:
name: release notes
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate notes
run: |
echo "## Install" > notes.md
echo "" >> notes.md
echo "### Precompiled (sandboxed environments)" >> notes.md
echo '```sh' >> notes.md
echo 'curl -L https://github.com/triblespace/faculties/releases/download/'"${GITHUB_REF_NAME}"'/faculties-'"${GITHUB_REF_NAME}"'-aarch64-apple-darwin.tar.gz | tar -xz' >> notes.md
echo 'export PATH="$PWD/faculties-'"${GITHUB_REF_NAME}"'-aarch64-apple-darwin:$PATH"' >> notes.md
echo '```' >> notes.md
echo "" >> notes.md
echo "### From source (dev environments)" >> notes.md
echo '```sh' >> notes.md
echo 'cargo install --git https://github.com/triblespace/faculties --tag '"${GITHUB_REF_NAME}"' --bins' >> notes.md
echo '```' >> notes.md
- uses: softprops/action-gh-release@v2
with:
body_path: notes.md
append_body: true