-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (73 loc) · 2.79 KB
/
Copy pathrelease.yml
File metadata and controls
81 lines (73 loc) · 2.79 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
name: Release binaries
on:
push:
tags:
- "v*"
jobs:
build-and-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: npm ci
- run: npm run check
- run: npm run build:binaries
- name: Smoke test the native binary
run: |
chmod +x release-binaries/opencode-neuron-linux-x64
./release-binaries/opencode-neuron-linux-x64 --help | grep -q "opencode-neuron setup"
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "$GITHUB_REF_NAME" \
release-binaries/opencode-neuron-linux-x64 \
release-binaries/opencode-neuron-linux-arm64 \
release-binaries/opencode-neuron-darwin-x64 \
release-binaries/opencode-neuron-darwin-arm64 \
release-binaries/opencode-neuron-windows-x64.exe \
release-binaries/opencode-neuron-windows-arm64.exe \
--title "$GITHUB_REF_NAME" \
--generate-notes
- name: Update Scoop manifest
run: |
VERSION="${GITHUB_REF_NAME#v}"
REPO="Noser-Engineering/opencode-plugin-neuron"
HASH_X64=$(sha256sum release-binaries/opencode-neuron-windows-x64.exe | cut -d' ' -f1)
HASH_ARM64=$(sha256sum release-binaries/opencode-neuron-windows-arm64.exe | cut -d' ' -f1)
mkdir -p bucket
cat > bucket/opencode-neuron.json <<EOF
{
"version": "${VERSION}",
"description": "OpenCode plugin setup CLI for configurable LiteLLM proxies",
"homepage": "https://github.com/${REPO}",
"license": "MIT",
"architecture": {
"64bit": {
"url": "https://github.com/${REPO}/releases/download/${GITHUB_REF_NAME}/opencode-neuron-windows-x64.exe#/opencode-neuron.exe",
"hash": "${HASH_X64}"
},
"arm64": {
"url": "https://github.com/${REPO}/releases/download/${GITHUB_REF_NAME}/opencode-neuron-windows-arm64.exe#/opencode-neuron.exe",
"hash": "${HASH_ARM64}"
}
},
"bin": "opencode-neuron.exe"
}
EOF
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add bucket/opencode-neuron.json
git diff --cached --quiet || git commit -m "Update Scoop manifest to ${VERSION}"
git pull --rebase origin main
git push origin HEAD:main