33name : MSX Tile Forge Build & Release
44
55on :
6- # This is the PRIMARY trigger for all on-demand builds
76 workflow_dispatch :
8-
9- # This is the only AUTOMATIC trigger
107 schedule :
118 - cron : ' 0 2 * * *'
9+ push :
10+ branches :
11+ - ' TKT_*'
12+ tags :
13+ - ' v*'
1214
1315jobs :
1416 # #####################################################################
1517 # JOB 1: DEVELOPMENT BUILDS (On-demand from TKT branches)
1618 # #####################################################################
1719 dev_build :
1820 name : Developer Build
19- # This job runs ONLY when you manually trigger it AND you are on a TKT_* branch
20- if : github.event_name == 'workflow_dispatch' && startsWith(github.ref_name, 'TKT_')
21+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/heads/TKT_')
2122
2223 strategy :
2324 matrix :
2829 - name : Checkout code
2930 uses : actions/checkout@v4
3031 with :
32+ # --- THIS IS THE FIX ---
33+ # Explicitly check out the branch that triggered the workflow
34+ ref : ${{ github.ref_name }}
3135 fetch-depth : 0
3236
3337 - name : Set up Python
4044 shell : bash
4145 run : |
4246 BRANCH_NAME="${{ github.ref_name }}"
43- # Use a more complex sed to handle the nested branch structure
44- BASE_VERSION=$(echo "$BRANCH_NAME" | sed -n 's/.*REL_\([0-9._]*\)\/.*/\1/p')
47+ BASE_VERSION=$(echo "$BRANCH_NAME" | grep -oP 'REL_[0-9.]+' | sed 's/REL_//')
4548 TICKET_NUM=$(echo "$BRANCH_NAME" | grep -oP 'TKT_[0-9]+' | sed 's/TKT_//')
4649 BRANCH_BUILD_NUM=$(git rev-list --count HEAD)
4750 GLOBAL_BUILD_NUM="${{ github.run_number }}"
@@ -67,10 +70,15 @@ jobs:
6770 build_rc_release :
6871 name : Release Candidate Build
6972 if : github.event_name == 'workflow_dispatch' && startsWith(github.ref_name, 'REL_')
70- # --- THIS LINE WAS MISSING ---
7173 runs-on : ubuntu-latest
7274
7375 steps :
76+ - name : Checkout code
77+ uses : actions/checkout@v4
78+ with :
79+ # --- THIS IS THE FIX ---
80+ ref : ${{ github.ref_name }}
81+
7482 - name : Placeholder for RC Build
7583 run : echo "RC build for branch ${{ github.ref_name }} would run here."
7684
@@ -79,10 +87,17 @@ jobs:
7987 # #####################################################################
8088 nightly_build :
8189 name : Nightly Build
82- if : github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
83- # --- THIS LINE WAS MISSING ---
90+ if : github.event_name == 'schedule'
8491 runs-on : ubuntu-latest
8592
8693 steps :
94+ - name : Checkout code
95+ uses : actions/checkout@v4
96+ with :
97+ # --- THIS IS THE FIX ---
98+ # In a real nightly, we would check out a specific branch like 'master'
99+ # but for this structure, we'll keep it simple for now.
100+ ref : ${{ github.ref_name }}
101+
87102 - name : Placeholder for Nightly Build
88103 run : echo "Nightly build would run here."
0 commit comments