-
-
Notifications
You must be signed in to change notification settings - Fork 20
139 lines (117 loc) · 4.34 KB
/
Copy pathrelease.yml
File metadata and controls
139 lines (117 loc) · 4.34 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
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
# Update build pak.json (will be copied during build)
mkdir -p build64/Grout.pak
jq --arg version "${{ steps.version.outputs.value }}" \
--arg changelog "${{ inputs.changelog }}" \
'.version = $version | .changelog[$version] = $changelog' \
pak.json > build64/Grout.pak/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 Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and Package
run: task build extract package-next package-muos package-knulli package-spruce package-rocknix package-trimui
- name: Create NextUI distribution
run: |
cd build64/Grout.pak
zip -r ../Grout.pak.zip .
- name: Create muOS distribution
run: |
cd build64/muOS
zip -r Grout.muxapp Grout
mv Grout.muxapp ../Grout.muxapp
- name: Create Knulli distribution
run: |
cd build64/Knulli
zip -r ../Grout-Knulli.zip Grout
- name: Create spruce distribution
run: |
cd build64/Spruce
zip -r Grout.spruce.zip Grout
mv Grout.spruce.zip ../Grout.spruce.zip
- name: Create ROCKNIX distribution
run: |
cd build64/ROCKNIX
zip -r ../Grout-ROCKNIX.zip Grout.sh Grout
- name: Create Trimui distribution
run: |
cd build64/Trimui
zip -r ../Grout-Trimui.zip 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: |
build64/Grout.pak.zip
build64/Grout.muxapp
build64/Grout.spruce.zip
build64/Grout-Knulli.zip
build64/Grout-ROCKNIX.zip
build64/Grout-Trimui.zip
build64/grout
draft: false
prerelease: ${{ inputs.beta }}