-
Notifications
You must be signed in to change notification settings - Fork 1.4k
145 lines (125 loc) · 4.54 KB
/
release.yml
File metadata and controls
145 lines (125 loc) · 4.54 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: write
jobs:
goreleaser:
# Guard: only run goreleaser in the canonical repository (not in forks)
if: ${{ github.repository == 'steveyegge/beads' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
- name: Install cross-compilation toolchains and signing tools
run: |
sudo apt-get update
sudo apt-get install -y gcc-mingw-w64-x86-64 gcc-aarch64-linux-gnu osslsigncode libicu-dev
- name: Install Zig
uses: mlugg/setup-zig@v2
with:
version: 0.14.0
- name: Create zig cross-compilation wrappers
run: |
mkdir -p /tmp/zigcc
for pair in \
"cc-x86_64-macos:x86_64-macos" \
"cc-aarch64-macos:aarch64-macos" \
"cc-aarch64-windows-gnu:aarch64-windows-gnu" \
"cc-aarch64-linux-android:aarch64-linux-android" \
"cc-x86_64-freebsd:x86_64-freebsd"; do
name="${pair%%:*}"
target="${pair##*:}"
# Build wrapper: strip -lresolv entirely. The macOS builds use the
# netgo tag (pure-Go DNS), so libresolv is not needed. Zig's sysroot
# has neither libresolv nor libresolv.9 (ziglang/zig#16674).
# Serialize zig calls per target with flock to prevent races.
{
echo '#!/bin/bash'
echo 'args=()'
echo 'for arg in "$@"; do'
echo ' [[ "$arg" == "-lresolv" ]] && continue'
echo ' args+=("$arg")'
echo 'done'
printf 'exec flock /tmp/zigcc/lock-%s zig cc -target %s "${args[@]}"\n' \
"$target" "$target"
} > "/tmp/zigcc/$name"
chmod +x "/tmp/zigcc/$name"
done
- name: Install go-winres for Windows PE resource embedding
run: go install github.com/tc-hib/go-winres@latest
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: '~> v2'
args: >
release --clean --parallelism 1
${{ github.repository != 'steveyegge/beads' && '--skip=publish --skip=announce' || '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Homebrew tap publishing (requires PAT with contents:write on homebrew-beads)
# If not set, goreleaser skips tap upload (skip_upload: auto in .goreleaser.yml)
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
# Windows code signing (optional - signing is skipped if not set)
WINDOWS_SIGNING_CERT_PFX_BASE64: ${{ secrets.WINDOWS_SIGNING_CERT_PFX_BASE64 }}
WINDOWS_SIGNING_CERT_PASSWORD: ${{ secrets.WINDOWS_SIGNING_CERT_PASSWORD }}
publish-pypi:
runs-on: ubuntu-latest
needs: goreleaser
if: ${{ always() && github.repository == 'steveyegge/beads' }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Install uv
run: pip install uv
- name: Build package
run: |
cd integrations/beads-mcp
uv build
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
cd integrations/beads-mcp
uv tool run twine upload dist/*
publish-npm:
runs-on: ubuntu-latest
needs: goreleaser
if: ${{ github.repository == 'steveyegge/beads' }}
permissions:
contents: read
id-token: write # Required for npm provenance/trusted publishing
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
- name: Update npm for OIDC trusted publishing
run: npm install -g npm@latest # Requires npm >= 11.5.1 for trusted publishing
- name: Publish to npm
run: |
cd npm-package
npm publish --access public
# Uses OIDC trusted publishing - no token needed
# Provenance attestations are automatic with trusted publishing