Skip to content

Commit 20dbb35

Browse files
committed
chore: build amd64 and arm64 binaries
1 parent 36d9dd7 commit 20dbb35

1 file changed

Lines changed: 98 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 98 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,85 @@ on:
66
- "v*"
77

88
jobs:
9-
build:
9+
binary-build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- uses: oven-sh/setup-bun@v2
16+
with:
17+
bun-version: latest
18+
19+
- uses: actions/setup-go@v5
20+
with:
21+
go-version: "^1.23.2"
22+
23+
- name: Install frontend dependencies
24+
run: |
25+
cd frontend
26+
bun install
27+
28+
- name: Install backend dependencies
29+
run: |
30+
go mod tidy
31+
32+
- name: Build frontend
33+
run: |
34+
cd frontend
35+
bun run build
36+
37+
- name: Build
38+
run: |
39+
cp -r frontend/dist internal/assets/dist
40+
CGO_ENABLED=0 go build -ldflags "-s -w" -o tinyauth-amd64
41+
42+
- name: Upload artifact
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: tinyauth-amd64
46+
path: tinyauth-amd64
47+
48+
binary-build-arm:
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v4
53+
54+
- uses: oven-sh/setup-bun@v2
55+
with:
56+
bun-version: latest
57+
58+
- uses: actions/setup-go@v5
59+
with:
60+
go-version: "^1.23.2"
61+
62+
- name: Install frontend dependencies
63+
run: |
64+
cd frontend
65+
bun install
66+
67+
- name: Install backend dependencies
68+
run: |
69+
go mod tidy
70+
71+
- name: Build frontend
72+
run: |
73+
cd frontend
74+
bun run build
75+
76+
- name: Build
77+
run: |
78+
cp -r frontend/dist internal/assets/dist
79+
CGO_ENABLED=0 go build -ldflags "-s -w" -o tinyauth-arm64
80+
81+
- name: Upload artifact
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: tinyauth-arm64
85+
path: tinyauth-arm64
86+
87+
image-build:
1088
runs-on: ubuntu-latest
1189
steps:
1290
- name: Checkout
@@ -51,7 +129,7 @@ jobs:
51129
if-no-files-found: error
52130
retention-days: 1
53131

54-
build-arm:
132+
image-build-arm:
55133
runs-on: ubuntu-24.04-arm
56134
steps:
57135
- name: Checkout
@@ -96,11 +174,11 @@ jobs:
96174
if-no-files-found: error
97175
retention-days: 1
98176

99-
merge:
177+
image-merge:
100178
runs-on: ubuntu-latest
101179
needs:
102-
- build
103-
- build-arm
180+
- image-build
181+
- image-build-arm
104182
steps:
105183
- name: Download digests
106184
uses: actions/download-artifact@v4
@@ -134,3 +212,18 @@ jobs:
134212
run: |
135213
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
136214
$(printf 'ghcr.io/${{ github.repository_owner }}/tinyauth@sha256:%s ' *)
215+
216+
update-release:
217+
runs-on: ubuntu-latest
218+
needs:
219+
- binary-build
220+
- binary-build-arm
221+
steps:
222+
- uses: actions/download-artifact@v4
223+
with:
224+
path: binaries
225+
226+
- name: Release
227+
uses: softprops/action-gh-release@v2
228+
with:
229+
files: binaries/*

0 commit comments

Comments
 (0)