Create Unity Release PR #11
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 | |
| # required for linux runners | |
| - name: Set up Unity | |
| uses: game-ci/unity-install@v4 | |
| with: | |
| unityVersion: '2021.3.0f1' # the oldest version of Unity we want to support and upload from | |
| components: linux-il2cpp android ios | |
| githubToken: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Prepare Environment | |
| run: | | |
| brew install gh jq || true | |
| gh auth status || gh auth login --with-token <<< "$GH_TOKEN" | |
| - 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 |