Skip to content

Commit f81ef35

Browse files
committed
feat: add GitHub Actions workflow for building and releasing plugin assets
1 parent c9ca6bf commit f81ef35

1 file changed

Lines changed: 79 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Build and Release Plugin Assets
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build-and-release:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: "1.24"
24+
25+
- name: Setup Bun
26+
uses: oven-sh/setup-bun@v2
27+
with:
28+
bun-version: latest
29+
30+
- name: Build backend WASM
31+
run: |
32+
set -euo pipefail
33+
mkdir -p release/backend
34+
GOOS=wasip1 GOARCH=wasm go build -buildmode=c-shared -o release/backend/checklist.wasm ./backend
35+
36+
- name: Build frontend
37+
working-directory: frontend
38+
run: |
39+
set -euo pipefail
40+
bun install --frozen-lockfile
41+
bun run build
42+
43+
- name: Collect release files
44+
run: |
45+
set -euo pipefail
46+
mkdir -p release/frontend
47+
cp -R frontend/dist release/frontend/dist
48+
49+
mkdir -p release/migrations
50+
cp -R backend/migrations/. release/migrations/
51+
52+
cp plugin.json release/plugin.json
53+
54+
- name: Create archives
55+
run: |
56+
set -euo pipefail
57+
tar -czf checklist-backend-wasm.tar.gz -C release/backend checklist.wasm
58+
tar -czf checklist-frontend-dist.tar.gz -C release/frontend dist
59+
tar -czf checklist-migrations.tar.gz -C release migrations
60+
tar -czf checklist-plugin-manifest.tar.gz -C release plugin.json
61+
62+
- name: Generate checksums
63+
run: |
64+
set -euo pipefail
65+
sha256sum checklist-backend-wasm.tar.gz \
66+
checklist-frontend-dist.tar.gz \
67+
checklist-migrations.tar.gz \
68+
checklist-plugin-manifest.tar.gz > checksums.txt
69+
70+
- name: Publish GitHub Release assets
71+
uses: softprops/action-gh-release@v2
72+
with:
73+
generate_release_notes: true
74+
files: |
75+
checklist-backend-wasm.tar.gz
76+
checklist-frontend-dist.tar.gz
77+
checklist-migrations.tar.gz
78+
checklist-plugin-manifest.tar.gz
79+
checksums.txt

0 commit comments

Comments
 (0)