Repository navigation
128 lines (115 loc) · 4.76 KB
/
Copy pathrelease.yml
File metadata and controls
128 lines (115 loc) · 4.76 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
name: Release binaries
# Triggered by pushing a version tag: `git tag v0.3.0 && git push origin v0.3.0`. The tag IS the version —
# the single source of truth, nothing to keep in sync with packages/cli/package.json (whose own version
# field is unrelated and never read for this; this package is never published to npm, see its "private"
# field). workflow_dispatch stays available for re-running the pipeline manually (e.g. while iterating on
# this workflow itself) via an explicit `version` input, without needing to push a throwaway tag.
#
# Builds a standalone sessionforge binary per platform (Node's Single Executable Application feature — no
# Node.js needed on the machine that runs it) and packages the Paseo plugin, attaching both to a GitHub
# Release.
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: "Version to release (no leading v), e.g. 0.3.0"
required: true
jobs:
version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.resolve.outputs.version }}
steps:
- name: Resolve version from the trigger (tag ref, or the manual input)
id: resolve
env:
MANUAL_VERSION: ${{ inputs.version }}
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "version=$MANUAL_VERSION" >> "$GITHUB_OUTPUT"
else
echo "version=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"
fi
build-binaries:
needs: version
strategy:
fail-fast: false
matrix:
include:
# SEA binaries aren't cross-compilable — each has to be built natively on its own target OS/arch.
# macos-13 (Intel) was fully retired by GitHub on 2025-12-04 — jobs queue forever with zero
# runners once that happens, which is exactly what broke this the first time. macos-14 is also
# mid-deprecation (began 2026-07-06, gone by 2026-11-02), so both entries use the current
# non-deprecated labels GitHub recommends instead: macos-15-intel for Intel, macos-15 for Apple
# Silicon. Re-check for deprecation notices before ever reusing a pinned macos-N label here again.
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-15-intel # Intel
target: x86_64-apple-darwin
- os: macos-15 # Apple Silicon
target: aarch64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
# Uses latest "22" rather than pinning the engines.node floor (22.16.0) — ci.yml's
# minimum-node-version job already covers that; this just needs a modern, working Node/npm to build
# binaries with. The resulting binary embeds this build's own Node runtime (SEA), which is separate
# from — and doesn't need to match — the floor documented for source/npm installs.
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
- run: npm install
- run: npm run build:binary --workspace packages/cli
env:
SESSIONFORGE_VERSION: ${{ needs.version.outputs.version }}
- uses: actions/upload-artifact@v4
with:
name: sessionforge-${{ matrix.target }}
path: packages/cli/build/sessionforge-${{ matrix.target }}*
if-no-files-found: error
# The Paseo plugin (this repo's root — index.ts, main.client.tsx, src/server/*) isn't OS/arch-specific
# like the CLI binaries above, so it only needs one job. `sessionforge wire-paseo` downloads this exact
# asset and points a local `paseo plugin install` at it.
package-plugin:
needs: version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
- run: npm install
- run: npm run package:plugin
env:
SESSIONFORGE_VERSION: ${{ needs.version.outputs.version }}
- uses: actions/upload-artifact@v4
with:
name: sessionforge-paseo-plugin
path: build/sessionforge-paseo-plugin.tar.gz
if-no-files-found: error
release:
needs: [version, build-binaries, package-plugin]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create release and upload binaries
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ needs.version.outputs.version }}
run: |
gh release create "v$VERSION" \
--title "sessionforge v$VERSION" \
--generate-notes \
artifacts/*/*