-
-
Notifications
You must be signed in to change notification settings - Fork 20
279 lines (232 loc) · 8.08 KB
/
Copy pathrelease.yml
File metadata and controls
279 lines (232 loc) · 8.08 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
name: Create Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version number (e.g., v4.6.1.0 or v4.6.0.0-beta.1)'
required: true
type: string
changelog:
description: 'Changelog message for this release'
required: true
type: string
beta:
description: 'Beta release (skips pak.json commit, marks as prerelease)'
required: false
type: boolean
default: false
permissions:
contents: write
jobs:
prepare:
runs-on: ubuntu-22.04-arm
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set version
id: version
run: |
VERSION=$(echo "${{ inputs.version }}" | xargs)
echo "value=$VERSION" >> $GITHUB_OUTPUT
- name: Update pak.json files
run: |
# Check current version
CURRENT_VERSION=$(jq -r '.version' pak.json)
if [ "$CURRENT_VERSION" != "${{ steps.version.outputs.value }}" ]; then
echo "Updating pak.json from $CURRENT_VERSION to ${{ steps.version.outputs.value }}"
# Update root pak.json
jq --arg version "${{ steps.version.outputs.value }}" \
--arg changelog "${{ inputs.changelog }}" \
'.version = $version | .changelog[$version] = $changelog' \
pak.json > pak.json.tmp && mv pak.json.tmp pak.json
else
echo "Version is already ${{ steps.version.outputs.value }}, skipping pak.json update"
fi
- name: Commit pak.json changes
if: ${{ inputs.beta == false }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
if git diff --quiet pak.json; then
echo "No changes to commit"
else
git add pak.json
git commit -m "Update pak.json to ${{ steps.version.outputs.value }}"
git push
fi
outputs:
version: ${{ steps.version.outputs.value }}
build-arm64:
needs: prepare
runs-on: ubuntu-22.04-arm
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build ARM64
run: task build extract
- name: Package ARM64 platforms
run: task package-next package-muos package-knulli package-spruce package-rocknix package-trimui package-batocera
- name: Rename binary
run: cp build64/grout build64/grout-arm64
- name: Create distributions
run: |
cd dist/Grout.pak && zip -r ../Grout.pak.zip . && cd ../..
cd dist/muOS && zip -r Grout.muxapp Grout && mv Grout.muxapp ../Grout.muxapp && cd ../..
cd dist/Knulli && zip -r ../Grout-Knulli.zip Grout && cd ../..
cd dist/Spruce && zip -r Grout.spruce.zip Grout && mv Grout.spruce.zip ../Grout.spruce.zip && cd ../..
cd dist/ROCKNIX && zip -r ../Grout-ROCKNIX.zip Grout.sh Grout && cd ../..
cd dist/Trimui && zip -r ../Grout-Trimui.zip Grout && cd ../..
cd dist/Batocera-arm64 && zip -r ../Grout-Batocera-arm64.zip Grout.sh Grout && cd ../..
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: arm64-artifacts
path: |
dist/Grout.pak.zip
dist/Grout.muxapp
dist/Grout.spruce.zip
dist/Grout-Knulli.zip
dist/Grout-ROCKNIX.zip
dist/Grout-Trimui.zip
dist/Grout-Batocera-arm64.zip
build64/grout-arm64
build-amd64:
needs: prepare
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build AMD64
run: task build-amd64 extract-amd64
- name: Package Batocera AMD64
run: task package-batocera-amd64
- name: Rename binary
run: cp build/grout build/grout-amd64
- name: Create distribution
run: |
cd dist/Batocera-amd64 && zip -r ../Grout-Batocera-amd64.zip Grout.sh Grout
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: amd64-artifacts
path: |
dist/Grout-Batocera-amd64.zip
build/grout-amd64
build-x86:
needs: prepare
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build x86
run: task build-x86 extract-x86
- name: Package Batocera x86
run: task package-batocera-x86
- name: Rename binary
run: cp buildx86/grout buildx86/grout-x86
- name: Create distribution
run: |
cd dist/Batocera-x86 && zip -r ../Grout-Batocera-x86.zip Grout.sh Grout
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: x86-artifacts
path: |
dist/Grout-Batocera-x86.zip
buildx86/grout-x86
build-arm32:
needs: prepare
runs-on: ubuntu-22.04-arm
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build ARM32
run: task build-32 extract-32
- name: Package ARM32 platforms
run: task package-allium package-onion
- name: Rename binary
run: cp build32/grout build32/grout-arm32
- name: Create distributions
run: |
cd dist/Allium && zip -r ../Grout-Allium.zip Grout.pak && cd ../..
cd dist/Onion && zip -r ../Grout-Onion.zip Grout && cd ../..
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: arm32-artifacts
path: |
dist/Grout-Allium.zip
dist/Grout-Onion.zip
build32/grout-arm32
release:
needs: [prepare, build-arm64, build-amd64, build-x86, build-arm32]
runs-on: ubuntu-22.04
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.prepare.outputs.version }}
name: ${{ needs.prepare.outputs.version }}
body: |
${{ inputs.beta && '⚠️ **This is a beta release.** It may contain bugs or incomplete features.' || '' }}
${{ inputs.changelog }}
${{ inputs.beta && format('Built from branch: `{0}`', github.ref_name) || '' }}
files: |
dist/Grout.pak.zip
dist/Grout.muxapp
dist/Grout.spruce.zip
dist/Grout-Allium.zip
dist/Grout-Onion.zip
dist/Grout-Knulli.zip
dist/Grout-ROCKNIX.zip
dist/Grout-Trimui.zip
dist/Grout-Batocera-arm64.zip
dist/Grout-Batocera-x86.zip
dist/Grout-Batocera-amd64.zip
build64/grout-arm64
build/grout-amd64
buildx86/grout-x86
build32/grout-arm32
draft: false
prerelease: ${{ inputs.beta }}