Skip to content

Create Release

Create Release #34

Workflow file for this run

name: Create Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version number (e.g., v1.2.0 or v1.2.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: Update pak.json files
run: |
# Check current version
CURRENT_VERSION=$(jq -r '.version' pak.json)
if [ "$CURRENT_VERSION" != "${{ inputs.version }}" ]; then
echo "Updating pak.json from $CURRENT_VERSION to ${{ inputs.version }}"
# Update root pak.json
jq --arg version "${{ inputs.version }}" \
--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 build/Grout.pak
jq --arg version "${{ inputs.version }}" \
--arg changelog "${{ inputs.changelog }}" \
'.version = $version | .changelog[$version] = $changelog' \
pak.json > build/Grout.pak/pak.json
else
echo "Version is already ${{ inputs.version }}, 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 ${{ inputs.version }}"
git push
fi
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Package
run: task build extract package-next package-muos package-knulli package-spruce
- name: Create NextUI distribution
run: |
cd build/Grout.pak
zip -r ../Grout.pak.zip .
- name: Create muOS distribution
run: |
cd build/muOS
zip -r Grout.muxapp Grout
mv Grout.muxapp ../Grout.muxapp
- name: Create Knulli distribution
run: |
cd build/Knulli
zip -r ../Grout-Knulli.zip Grout
- name: Create spruce distribution
run: |
cd build/Spruce
zip -r Grout.spruce.zip Grout
mv Grout.spruce.zip ../Grout.spruce.zip
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.version }}
name: ${{ inputs.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: |
build/Grout.pak.zip
build/Grout.muxapp
build/Grout.spruce.zip
build/Grout-Knulli.zip
build/grout
draft: false
prerelease: ${{ inputs.beta }}