-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (98 loc) · 3.53 KB
/
Copy pathrelease-binaries.yml
File metadata and controls
115 lines (98 loc) · 3.53 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
name: Release Binaries
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: release-binaries-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
env:
ACP_RUNTIME_REPO_URL: https://github.com/saaskit-dev/acp-runtime.git
BUN_VERSION: 1.3.14
FREE_BINARY_TARGETS: bun-darwin-arm64,bun-darwin-x64,bun-linux-arm64,bun-linux-x64
jobs:
release-binaries:
name: Build and publish latest binaries
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout Free
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Clone pinned acp-runtime
shell: bash
run: |
set -euo pipefail
ACP_RUNTIME_REF="$(sed -e 's/[[:space:]]*$//' -e '/^$/d' .acp-runtime-ref | head -n 1)"
if [ -z "$ACP_RUNTIME_REF" ]; then
echo "Missing pinned acp-runtime ref in .acp-runtime-ref" >&2
exit 1
fi
rm -rf ../acp-runtime
git init ../acp-runtime
git -C ../acp-runtime remote add origin "$ACP_RUNTIME_REPO_URL"
git -C ../acp-runtime fetch --depth 1 origin "$ACP_RUNTIME_REF"
git -C ../acp-runtime checkout --detach FETCH_HEAD
- name: Install and build pinned acp-runtime
shell: bash
run: |
set -euo pipefail
cd ../acp-runtime
bun install --frozen-lockfile
bun run --cwd packages/simulator-agent build
bun run build:lib
- name: Install Free dependencies
run: bun install --frozen-lockfile
- name: Build Bun binaries
run: make build-binary
- name: Smoke-test Linux binary
shell: bash
run: |
set -euo pipefail
./dist-bin/free-linux-x64 --help >/dev/null
./dist-bin/free-linux-x64 auth --help >/dev/null
./dist-bin/free-linux-x64 host --help >/dev/null
./dist-bin/free-linux-x64 bridge config --relay-url ws://127.0.0.1:8791 --command ./dist-bin/free-linux-x64 --format generic >/dev/null
- name: Generate checksums
run: shasum -a 256 dist-bin/free-* > dist-bin/SHA256SUMS
- name: Publish latest GitHub release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
set -euo pipefail
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag -f latest "$GITHUB_SHA"
git push -f origin latest
mkdir -p .tmp
cat > .tmp/latest-release-notes.md <<EOF
Latest Free binary build from ${GITHUB_SHA}.
Install:
curl -fsSL https://free.saaskit.app/install | bash
Direct assets are attached to this release.
EOF
if gh release view latest >/dev/null 2>&1; then
gh release edit latest \
--target "$GITHUB_SHA" \
--title "Latest Free binary" \
--notes-file .tmp/latest-release-notes.md
else
gh release create latest \
--target "$GITHUB_SHA" \
--title "Latest Free binary" \
--notes-file .tmp/latest-release-notes.md
fi
gh release upload latest dist-bin/free-* dist-bin/SHA256SUMS --clobber