Skip to content

Commit 19902eb

Browse files
committed
Fixing release.yml
1 parent 4f93f1c commit 19902eb

1 file changed

Lines changed: 25 additions & 10 deletions

File tree

.github/workflows/release.yml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@
33
name: MSX Tile Forge Build & Release
44

55
on:
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

1315
jobs:
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:
@@ -28,6 +29,9 @@ jobs:
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
@@ -40,8 +44,7 @@ jobs:
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

Comments
 (0)