Skip to content

Commit 6c73377

Browse files
committed
Consolidate 3 release workflows into 1 with 3 jobs
1 parent 6db86b6 commit 6c73377

4 files changed

Lines changed: 93 additions & 107 deletions

File tree

.github/workflows/release-docker.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/release-go.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/release-npm.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
release-npm:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-go@v5
19+
with:
20+
go-version: "1.26"
21+
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: "26"
25+
26+
- name: Build
27+
run: |
28+
GOOS=js GOARCH=wasm go build -o public/expr.wasm ./wasm
29+
npm ci
30+
npm run build
31+
32+
- name: Publish
33+
run: npm publish
34+
35+
release-docker:
36+
runs-on: ubuntu-latest
37+
permissions:
38+
contents: read
39+
packages: write
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- name: Build Docker image
45+
run: docker build -t expr-editor .
46+
47+
- name: Push to GitHub Container Registry
48+
run: |
49+
echo "${{ github.token }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
50+
IMG=ghcr.io/${{ github.repository }}
51+
docker tag expr-editor $IMG:${{ github.ref_name }}
52+
docker tag expr-editor $IMG:latest
53+
docker push $IMG:${{ github.ref_name }}
54+
docker push $IMG:latest
55+
56+
release-go:
57+
runs-on: ubuntu-latest
58+
permissions:
59+
contents: write
60+
61+
steps:
62+
- uses: actions/checkout@v4
63+
64+
- uses: actions/setup-go@v5
65+
with:
66+
go-version: "1.26"
67+
68+
- uses: actions/setup-node@v4
69+
with:
70+
node-version: "26"
71+
72+
- name: Build
73+
run: |
74+
GOOS=js GOARCH=wasm go build -o public/expr.wasm ./wasm
75+
npm ci
76+
npm run build
77+
78+
- name: Cross-compile platform binaries
79+
run: |
80+
for pair in "linux/amd64" "linux/arm64" "darwin/amd64" "darwin/arm64"; do
81+
os=$(echo $pair | cut -d/ -f1)
82+
arch=$(echo $pair | cut -d/ -f2)
83+
CGO_ENABLED=0 GOOS=$os GOARCH=$arch go build -o expr-editor-$os-$arch .
84+
done
85+
86+
- name: Upload to GitHub Release
87+
uses: softprops/action-gh-release@v2
88+
with:
89+
files: |
90+
expr-editor-linux-amd64
91+
expr-editor-linux-arm64
92+
expr-editor-darwin-amd64
93+
expr-editor-darwin-arm64

0 commit comments

Comments
 (0)