Fixing the version generation rules. #11
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
| # .github/workflows/release.yml | ||
| name: MSX Tile Forge Build Orchestrator | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| build_type: | ||
| description: 'Type of build to run' | ||
| required: true | ||
| default: 'dev_build' | ||
| type: choice | ||
| options: [dev_build] # Add other types like 'rc_build' back in later | ||
| jobs: | ||
| ############################################################ | ||
| # JOB 1: Calculate Version and Trigger Worker Workflows | ||
| ############################################################ | ||
| call_builds: | ||
| name: Calculate Version & Call Builds | ||
| runs-on: ubuntu-latest | ||
| # Define outputs that this job will pass to other jobs | ||
| outputs: | ||
| version_string: ${{ steps.versioning.outputs.VERSION_STRING }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Construct Dev Version String | ||
| id: versioning | ||
| run: | | ||
| BRANCH_NAME="${{ github.ref_name }}" | ||
| # This more robust command finds the REL_ part anywhere in the string | ||
| BASE_VERSION=$(echo "$BRANCH_NAME" | grep -oP 'REL_[0-9.]+' | sed 's/REL_//') | ||
| # This more robust command finds the TKT_ part anywhere in the string | ||
| TICKET_NUM=$(echo "$BRANCH_NAME" | grep -oP 'TKT_[0-9]+' | sed 's/TKT_//') | ||
| BRANCH_BUILD_NUM=$(git rev-list --count HEAD) | ||
| GLOBAL_BUILD_NUM="${{ github.run_number }}" | ||
| FINAL_VERSION="v${BASE_VERSION}_dev${TICKET_NUM}.${BRANCH_BUILD_NUM}_${GLOBAL_BUILD_NUM}" | ||
| echo "VERSION_STRING=${FINAL_VERSION}" >> $GITHUB_ENV | ||
| # You would add more "Construct Version String" steps here for RC, Final, etc. | ||
| ############################################################ | ||
| # JOB 2: Run the actual builds by calling the reusable workflows | ||
| ############################################################ | ||
| build_binaries: | ||
| name: Build Binaries | ||
| needs: call_builds # This job waits for the version calculation to finish | ||
| uses: ./.github/workflows/build-windows.yml | ||
| with: | ||
| version_string: ${{ needs.call_builds.outputs.version_string }} | ||
| build_linux_binaries: | ||
| name: Build Linux Binaries | ||
| needs: call_builds | ||
| uses: ./.github/workflows/build-linux.yml | ||
| with: | ||
| version_string: ${{ needs.call_builds.outputs.version_string }} | ||