-
-
Notifications
You must be signed in to change notification settings - Fork 20
156 lines (130 loc) · 4.64 KB
/
Copy pathrelease.yml
File metadata and controls
156 lines (130 loc) · 4.64 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
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:
release:
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
- 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 and Package (64-bit)
run: task build extract package-next package-muos package-knulli package-spruce package-rocknix package-trimui package-batocera
- name: Build and Package (32-bit)
run: task build-32 extract-32 package-allium package-onion
- name: Create NextUI distribution
run: |
cd dist/Grout.pak
zip -r ../Grout.pak.zip .
- name: Create muOS distribution
run: |
cd dist/muOS
zip -r Grout.muxapp Grout
mv Grout.muxapp ../Grout.muxapp
- name: Create Knulli distribution
run: |
cd dist/Knulli
zip -r ../Grout-Knulli.zip Grout
- name: Create spruce distribution
run: |
cd dist/Spruce
zip -r Grout.spruce.zip Grout
mv Grout.spruce.zip ../Grout.spruce.zip
- name: Create ROCKNIX distribution
run: |
cd dist/ROCKNIX
zip -r ../Grout-ROCKNIX.zip Grout.sh Grout
- name: Create Trimui distribution
run: |
cd dist/Trimui
zip -r ../Grout-Trimui.zip Grout
- name: Create Allium distribution
run: |
cd dist/Allium
zip -r ../Grout-Allium.zip Grout.pak
- name: Create Onion distribution
run: |
cd dist/Onion
zip -r ../Grout-Onion.zip Grout
- name: Create Batocera distribution
run: |
cd dist/Batocera
zip -r ../Grout-Batocera.zip Grout.sh Grout
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.value }}
name: ${{ steps.version.outputs.value }}
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.zip
build64/grout
draft: false
prerelease: ${{ inputs.beta }}