mirror of
https://github.com/rommapp/grout.git
synced 2026-04-23 06:54:36 +00:00
146 lines
4.5 KiB
YAML
146 lines
4.5 KiB
YAML
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 package-batocera
|
|
|
|
- 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 Batocera distribution
|
|
run: |
|
|
cd build64/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: |
|
|
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-Batocera.zip
|
|
build64/grout
|
|
draft: false
|
|
prerelease: ${{ inputs.beta }}
|