Skip to content

Commit 6227329

Browse files
feat: add x86 Batocera build and parallelize release workflow
- Add build-x86, extract-x86, and package-batocera-x86 tasks - Add x86 (386) to updater asset name resolution - Split release workflow into parallel jobs per architecture: build-arm64, build-amd64, build-x86, build-arm32 - Each job uploads artifacts, final release job collects and publishes - Release now ships grout-arm64, grout-amd64, grout-x86, grout-arm32 and Batocera zips for arm64, amd64, and x86 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4475e24 commit 6227329

3 files changed

Lines changed: 193 additions & 56 deletions

File tree

.github/workflows/release.yml

Lines changed: 160 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ permissions:
2121
contents: write
2222

2323
jobs:
24-
release:
24+
prepare:
2525
runs-on: ubuntu-22.04-arm
2626
steps:
2727
- uses: actions/checkout@v4
@@ -64,6 +64,104 @@ jobs:
6464
git commit -m "Update pak.json to ${{ steps.version.outputs.value }}"
6565
git push
6666
fi
67+
outputs:
68+
version: ${{ steps.version.outputs.value }}
69+
70+
build-arm64:
71+
needs: prepare
72+
runs-on: ubuntu-22.04-arm
73+
steps:
74+
- uses: actions/checkout@v4
75+
with:
76+
ref: ${{ github.ref }}
77+
78+
- name: Install Task
79+
uses: arduino/setup-task@v2
80+
with:
81+
version: 3.x
82+
repo-token: ${{ secrets.GITHUB_TOKEN }}
83+
84+
- name: Set up Docker Buildx
85+
uses: docker/setup-buildx-action@v3
86+
87+
- name: Build ARM64
88+
run: task build extract
89+
90+
- name: Package ARM64 platforms
91+
run: task package-next package-muos package-knulli package-spruce package-rocknix package-trimui package-batocera
92+
93+
- name: Rename binary
94+
run: cp build64/grout build64/grout-arm64
95+
96+
- name: Create distributions
97+
run: |
98+
cd dist/Grout.pak && zip -r ../Grout.pak.zip . && cd ../..
99+
cd dist/muOS && zip -r Grout.muxapp Grout && mv Grout.muxapp ../Grout.muxapp && cd ../..
100+
cd dist/Knulli && zip -r ../Grout-Knulli.zip Grout && cd ../..
101+
cd dist/Spruce && zip -r Grout.spruce.zip Grout && mv Grout.spruce.zip ../Grout.spruce.zip && cd ../..
102+
cd dist/ROCKNIX && zip -r ../Grout-ROCKNIX.zip Grout.sh Grout && cd ../..
103+
cd dist/Trimui && zip -r ../Grout-Trimui.zip Grout && cd ../..
104+
cd dist/Batocera-arm64 && zip -r ../Grout-Batocera-arm64.zip Grout.sh Grout && cd ../..
105+
106+
- name: Upload artifacts
107+
uses: actions/upload-artifact@v4
108+
with:
109+
name: arm64-artifacts
110+
path: |
111+
dist/Grout.pak.zip
112+
dist/Grout.muxapp
113+
dist/Grout.spruce.zip
114+
dist/Grout-Knulli.zip
115+
dist/Grout-ROCKNIX.zip
116+
dist/Grout-Trimui.zip
117+
dist/Grout-Batocera-arm64.zip
118+
build64/grout-arm64
119+
120+
build-amd64:
121+
needs: prepare
122+
runs-on: ubuntu-22.04
123+
steps:
124+
- uses: actions/checkout@v4
125+
with:
126+
ref: ${{ github.ref }}
127+
128+
- name: Install Task
129+
uses: arduino/setup-task@v2
130+
with:
131+
version: 3.x
132+
repo-token: ${{ secrets.GITHUB_TOKEN }}
133+
134+
- name: Set up Docker Buildx
135+
uses: docker/setup-buildx-action@v3
136+
137+
- name: Build AMD64
138+
run: task build-amd64 extract-amd64
139+
140+
- name: Package Batocera AMD64
141+
run: task package-batocera-amd64
142+
143+
- name: Rename binary
144+
run: cp build/grout build/grout-amd64
145+
146+
- name: Create distribution
147+
run: |
148+
cd dist/Batocera-amd64 && zip -r ../Grout-Batocera-amd64.zip Grout.sh Grout
149+
150+
- name: Upload artifacts
151+
uses: actions/upload-artifact@v4
152+
with:
153+
name: amd64-artifacts
154+
path: |
155+
dist/Grout-Batocera-amd64.zip
156+
build/grout-amd64
157+
158+
build-x86:
159+
needs: prepare
160+
runs-on: ubuntu-22.04
161+
steps:
162+
- uses: actions/checkout@v4
163+
with:
164+
ref: ${{ github.ref }}
67165

68166
- name: Install Task
69167
uses: arduino/setup-task@v2
@@ -77,78 +175,84 @@ jobs:
77175
- name: Set up Docker Buildx
78176
uses: docker/setup-buildx-action@v3
79177

80-
- name: Build and Package (64-bit ARM)
81-
run: task build extract package-next package-muos package-knulli package-spruce package-rocknix package-trimui package-batocera
178+
- name: Build x86
179+
run: task build-x86 extract-x86
82180

83-
- name: Build and Package (64-bit AMD64)
84-
run: task build-amd64 extract-amd64 package-batocera-amd64
181+
- name: Package Batocera x86
182+
run: task package-batocera-x86
85183

86-
- name: Build and Package (32-bit)
87-
run: task build-32 extract-32 package-allium package-onion
184+
- name: Rename binary
185+
run: cp buildx86/grout buildx86/grout-x86
88186

89-
- name: Rename architecture-specific binaries for release
187+
- name: Create distribution
90188
run: |
91-
cp build64/grout build64/grout-arm64
92-
cp build/grout build/grout-amd64
93-
cp build32/grout build32/grout-arm32
189+
cd dist/Batocera-x86 && zip -r ../Grout-Batocera-x86.zip Grout.sh Grout
94190
95-
- name: Create NextUI distribution
96-
run: |
97-
cd dist/Grout.pak
98-
zip -r ../Grout.pak.zip .
191+
- name: Upload artifacts
192+
uses: actions/upload-artifact@v4
193+
with:
194+
name: x86-artifacts
195+
path: |
196+
dist/Grout-Batocera-x86.zip
197+
buildx86/grout-x86
99198
100-
- name: Create muOS distribution
101-
run: |
102-
cd dist/muOS
103-
zip -r Grout.muxapp Grout
104-
mv Grout.muxapp ../Grout.muxapp
199+
build-arm32:
200+
needs: prepare
201+
runs-on: ubuntu-22.04-arm
202+
steps:
203+
- uses: actions/checkout@v4
204+
with:
205+
ref: ${{ github.ref }}
105206

106-
- name: Create Knulli distribution
107-
run: |
108-
cd dist/Knulli
109-
zip -r ../Grout-Knulli.zip Grout
207+
- name: Install Task
208+
uses: arduino/setup-task@v2
209+
with:
210+
version: 3.x
211+
repo-token: ${{ secrets.GITHUB_TOKEN }}
110212

111-
- name: Create spruce distribution
112-
run: |
113-
cd dist/Spruce
114-
zip -r Grout.spruce.zip Grout
115-
mv Grout.spruce.zip ../Grout.spruce.zip
213+
- name: Set up QEMU
214+
uses: docker/setup-qemu-action@v3
116215

117-
- name: Create ROCKNIX distribution
118-
run: |
119-
cd dist/ROCKNIX
120-
zip -r ../Grout-ROCKNIX.zip Grout.sh Grout
216+
- name: Set up Docker Buildx
217+
uses: docker/setup-buildx-action@v3
121218

122-
- name: Create Trimui distribution
123-
run: |
124-
cd dist/Trimui
125-
zip -r ../Grout-Trimui.zip Grout
219+
- name: Build ARM32
220+
run: task build-32 extract-32
126221

127-
- name: Create Allium distribution
128-
run: |
129-
cd dist/Allium
130-
zip -r ../Grout-Allium.zip Grout.pak
222+
- name: Package ARM32 platforms
223+
run: task package-allium package-onion
131224

132-
- name: Create Onion distribution
133-
run: |
134-
cd dist/Onion
135-
zip -r ../Grout-Onion.zip Grout
225+
- name: Rename binary
226+
run: cp build32/grout build32/grout-arm32
136227

137-
- name: Create Batocera ARM64 distribution
228+
- name: Create distributions
138229
run: |
139-
cd dist/Batocera-arm64
140-
zip -r ../Grout-Batocera-arm64.zip Grout.sh Grout
230+
cd dist/Allium && zip -r ../Grout-Allium.zip Grout.pak && cd ../..
231+
cd dist/Onion && zip -r ../Grout-Onion.zip Grout && cd ../..
141232
142-
- name: Create Batocera AMD64 distribution
143-
run: |
144-
cd dist/Batocera-amd64
145-
zip -r ../Grout-Batocera-amd64.zip Grout.sh Grout
233+
- name: Upload artifacts
234+
uses: actions/upload-artifact@v4
235+
with:
236+
name: arm32-artifacts
237+
path: |
238+
dist/Grout-Allium.zip
239+
dist/Grout-Onion.zip
240+
build32/grout-arm32
241+
242+
release:
243+
needs: [prepare, build-arm64, build-amd64, build-x86, build-arm32]
244+
runs-on: ubuntu-22.04
245+
steps:
246+
- name: Download all artifacts
247+
uses: actions/download-artifact@v4
248+
with:
249+
merge-multiple: true
146250

147251
- name: Create GitHub Release
148252
uses: softprops/action-gh-release@v2
149253
with:
150-
tag_name: ${{ steps.version.outputs.value }}
151-
name: ${{ steps.version.outputs.value }}
254+
tag_name: ${{ needs.prepare.outputs.version }}
255+
name: ${{ needs.prepare.outputs.version }}
152256
body: |
153257
${{ inputs.beta && '⚠️ **This is a beta release.** It may contain bugs or incomplete features.' || '' }}
154258
@@ -165,9 +269,11 @@ jobs:
165269
dist/Grout-ROCKNIX.zip
166270
dist/Grout-Trimui.zip
167271
dist/Grout-Batocera-arm64.zip
272+
dist/Grout-Batocera-x86.zip
168273
dist/Grout-Batocera-amd64.zip
169274
build64/grout-arm64
170275
build/grout-amd64
276+
buildx86/grout-x86
171277
build32/grout-arm32
172278
draft: false
173279
prerelease: ${{ inputs.beta }}

taskfile.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ tasks:
2222
- docker buildx build {{.NO_CACHE}} --load --platform=linux/amd64 --build-arg GITHUB_ACTIONS=false --label {{.LABEL}} -t {{.IMAGE_NAME}}-amd64 -f docker/Dockerfile .
2323
silent: true
2424

25+
build-x86:
26+
desc: Build for x86 (32-bit)
27+
cmds:
28+
- rm -rf buildx86
29+
- docker buildx build {{.NO_CACHE}} --load --platform=linux/386 --build-arg GITHUB_ACTIONS=false --label {{.LABEL}} -t {{.IMAGE_NAME}}-x86 -f docker/Dockerfile .
30+
silent: true
31+
2532
build-32:
2633
desc: Build for ARM32
2734
cmds:
@@ -65,6 +72,17 @@ tasks:
6572
- docker rm {{.CONTAINER_NAME}}
6673
silent: true
6774

75+
extract-x86:
76+
desc: Extract binary and libraries from x86 Docker image
77+
cmds:
78+
- mkdir -p buildx86/lib
79+
- docker rm {{.CONTAINER_NAME}} 2>/dev/null || true
80+
- docker create --name {{.CONTAINER_NAME}} --label {{.LABEL}} {{.IMAGE_NAME}}-x86
81+
- docker cp {{.CONTAINER_NAME}}:/build/grout buildx86/grout
82+
- docker cp {{.CONTAINER_NAME}}:/usr/lib/i386-linux-gnu/libSDL2_gfx-1.0.so.0.0.2 buildx86/lib/libSDL2_gfx-1.0.so.0
83+
- docker rm {{.CONTAINER_NAME}}
84+
silent: true
85+
6886
extract-32:
6987
desc: Extract binary and libraries from Docker image
7088
cmds:
@@ -78,7 +96,7 @@ tasks:
7896

7997
package:
8098
desc: Package for all platforms
81-
deps: [ package-next, package-muos, package-knulli, package-spruce, package-rocknix, package-trimui, package-allium, package-onion, package-batocera, package-batocera-amd64 ]
99+
deps: [ package-next, package-muos, package-knulli, package-spruce, package-rocknix, package-trimui, package-allium, package-onion, package-batocera, package-batocera-x86, package-batocera-amd64 ]
82100
silent: true
83101

84102
package-next:
@@ -177,6 +195,17 @@ tasks:
177195
- chmod a+x dist/Batocera-arm64/Grout/grout dist/Batocera-arm64/Grout.sh
178196
silent: true
179197

198+
package-batocera-x86:
199+
desc: Package for Batocera (x86 32-bit)
200+
cmds:
201+
- rm -rf dist/Batocera-x86
202+
- mkdir -p dist/Batocera-x86/Grout/lib
203+
- cp scripts/Batocera/Grout.sh dist/Batocera-x86/
204+
- cp buildx86/grout README.md LICENSE dist/Batocera-x86/Grout/
205+
- cp -R buildx86/lib/* dist/Batocera-x86/Grout/lib/
206+
- chmod a+x dist/Batocera-x86/Grout/grout dist/Batocera-x86/Grout.sh
207+
silent: true
208+
180209
package-batocera-amd64:
181210
desc: Package for Batocera (AMD64/x86_64)
182211
cmds:
@@ -343,7 +372,7 @@ tasks:
343372
clean:
344373
desc: Remove build artifacts
345374
cmds:
346-
- rm -rf build64 build32 dist
375+
- rm -rf build64 build buildx86 build32 dist
347376
silent: true
348377

349378
hooks-setup:

update/updater.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ func GetAssetName(c cfw.CFW) string {
3535
return "grout-arm32"
3636
case "amd64":
3737
return "grout-amd64"
38+
case "386":
39+
return "grout-x86"
3840
default:
3941
return ""
4042
}

0 commit comments

Comments
 (0)