Create Unity Release PR #21
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 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: Cache Unity installation | |
| id: cache-unity | |
| uses: actions/cache@v4 | |
| with: | |
| path: /home/runner/Unity | |
| key: unity-${{ runner.os }}-2021.3.0f1 | |
| - name: Setup Unity | |
| if: steps.cache-unity.outputs.cache-hit != 'true' | |
| uses: buildalon/[email protected] | |
| with: | |
| version: 2021.3.0f1 | |
| - 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 |