Create Release #82
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} |