Skip to content

Create Unity Release PR #39

Create Unity Release PR

Create Unity Release PR #39

name: Create Unity Release PR
on:
workflow_dispatch:
inputs:
bump_command:
description: "Version bump type (major, minor, patch, specify)"
required: true
type: choice
options:
- major
- minor
- patch
- specify
postfix:
description: "Optional postfix (e.g. preview, beta, or specific version when using 'specify')"
required: false
type: string
permissions:
contents: write
pull-requests: write
jobs:
compose-unity-release:
name: Compose Unity Release
runs-on: ubuntu-latest
timeout-minutes: 30
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUMP_COMMAND: ${{ github.event.inputs.bump_command }}
POSTFIX: ${{ github.event.inputs.postfix }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Prepare Environment
run: |
brew install gh jq || true
gh auth status || gh auth login --with-token <<< "$GH_TOKEN"
- name: Setup Unity
uses: buildalon/[email protected]
with:
unity-version: 2021.3.0f1
- uses: buildalon/activate-unity-license@v2
with:
license: 'Personal'
username: '${{ secrets.UNITY_USERNAME }}'
password: '${{ secrets.UNITY_PASSWORD }}'
- name: Verify Unity install
run: |
UNITY_PATH=$(find /home/runner -type f -name Unity | grep "Editor/Unity" | head -n 1)
echo "Unity found at: $UNITY_PATH"
$UNITY_PATH -version
- name: 🏗️ Run composeRelease.sh
run: |
chmod +x ./composeRelease.sh
if [[ -n "$POSTFIX" ]]; then
./composeRelease.sh "$BUMP_COMMAND" "$POSTFIX" || echo "composeRelease.sh failed, continuing to patch manually"
else
./composeRelease.sh "$BUMP_COMMAND" || echo "composeRelease.sh failed, continuing to patch manually"
fi
- name: 🔍 Confirm PR Exists
run: |
PR_URL=$(gh pr list --head "release/$VERSION" --json url --jq '.[0].url')
if [[ -n "$PR_URL" ]]; then
echo "✅ Release PR found: $PR_URL"
else
echo "⚠️ No PR found. composeRelease.sh should have created one."
echo "If missing, create manually from release/$VERSION → main."
fi