-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (60 loc) · 2.58 KB
/
Copy pathrelease.yml
File metadata and controls
67 lines (60 loc) · 2.58 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
name: release
# Tag-triggered. Pushing a tag like v0.1.0 cross-compiles the engine for
# every supported platform, generates sha256 checksums, and publishes them
# as a GitHub Release. The download script
# (plugin/skills/opendoc/scripts/download-binary.sh) consumes these assets and
# derives the tag from the plugin manifest's version, so the tag MUST equal the
# version in BOTH manifests (plugin/.claude-plugin/plugin.json and
# plugin/.codex-plugin/plugin.json) — enforced by the check step below.
#
# After the release is live, finish publishing by bumping the catalog repo
# (arcships/plugins): point the opendoc entry's `ref` at this tag in both
# .claude-plugin/marketplace.json and .agents/plugins/marketplace.json.
on:
push:
tags: ['v*']
# gh release create needs write access to create the release and upload assets.
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# The skill's download-binary.sh maps manifest version -> release tag, so a
# tag whose version isn't in the manifests would publish unreachable assets.
- name: check manifest versions match the tag
run: |
tag="${GITHUB_REF_NAME#v}"
for m in plugin/.claude-plugin/plugin.json plugin/.codex-plugin/plugin.json; do
v="$(jq -r .version "$m")"
if [ "$v" != "$tag" ]; then
echo "::error::$m version ($v) does not match tag ($GITHUB_REF_NAME)"
exit 1
fi
done
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
# Cross-compile all targets in one job — pure-Go, CGO-free, so a single
# Linux runner produces every platform binary in seconds. Flags match
# scripts/build-skill.sh (CGO_ENABLED=0, -trimpath) for reproducibility.
- name: cross-compile
run: |
mkdir -p dist
for target in darwin/arm64 darwin/amd64 linux/amd64 linux/arm64; do
os="${target%/*}"; arch="${target#*/}"
out="dist/opendoc-${os}-${arch}"
echo "building $out"
CGO_ENABLED=0 GOOS="$os" GOARCH="$arch" go build -trimpath -ldflags="-s -w" -o "$out" ./cmd/opendoc
done
( cd dist && sha256sum opendoc-* > checksums.txt && cat checksums.txt )
- name: publish release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "$GITHUB_REF_NAME" \
--repo "$GITHUB_REPOSITORY" \
--title "$GITHUB_REF_NAME" \
--generate-notes \
dist/opendoc-* dist/checksums.txt