Skip to content

Commit 4df1853

Browse files
committed
Updating release.yml.
1 parent 88697d9 commit 4df1853

1 file changed

Lines changed: 60 additions & 41 deletions

File tree

.github/workflows/release.yml

Lines changed: 60 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,87 @@
11
# .github/workflows/release.yml
22

3-
name: MSX Tile Forge Build Orchestrator
3+
name: MSX Tile Forge Build & Release
44

55
on:
6+
# This is now the PRIMARY trigger for all on-demand builds
67
workflow_dispatch:
7-
inputs:
8-
build_type:
9-
description: 'Type of build to run'
10-
required: true
11-
default: 'dev_build'
12-
type: choice
13-
options:
14-
- dev_build
15-
# Add other types like rc_build and nightly_build here when ready
8+
9+
# This is the only AUTOMATIC trigger
10+
schedule:
11+
- cron: '0 2 * * *'
1612

1713
jobs:
18-
############################################################
19-
# JOB 1: Calculate Version String
20-
############################################################
21-
prepare:
22-
name: Calculate Version
23-
runs-on: ubuntu-latest
24-
outputs:
25-
version_string: ${{ steps.versioning.outputs.VERSION_STRING }}
14+
######################################################################
15+
# JOB 1: DEVELOPMENT BUILDS (On-demand from TKT branches)
16+
######################################################################
17+
build_dev_artifact:
18+
name: Dev Build (TKT Branch)
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+
22+
strategy:
23+
matrix:
24+
os: [windows-latest, ubuntu-latest]
25+
runs-on: ${{ matrix.os }}
2626

2727
steps:
2828
- name: Checkout code
2929
uses: actions/checkout@v4
3030
with:
3131
fetch-depth: 0
3232

33+
- name: Set up Python
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: '3.10'
37+
3338
- name: Construct Dev Version String
3439
id: versioning
35-
if: github.event.inputs.build_type == 'dev_build'
40+
shell: bash
3641
run: |
3742
BRANCH_NAME="${{ github.ref_name }}"
38-
# Robustly find REL_... and TKT_... parts anywhere in the branch name
3943
BASE_VERSION=$(echo "$BRANCH_NAME" | grep -oP 'REL_[0-9.]+' | sed 's/REL_//')
4044
TICKET_NUM=$(echo "$BRANCH_NAME" | grep -oP 'TKT_[0-9]+' | sed 's/TKT_//')
4145
BRANCH_BUILD_NUM=$(git rev-list --count HEAD)
4246
GLOBAL_BUILD_NUM="${{ github.run_number }}"
4347
FINAL_VERSION="v${BASE_VERSION}_dev${TICKET_NUM}.${BRANCH_BUILD_NUM}_${GLOBAL_BUILD_NUM}"
4448
echo "VERSION_STRING=${FINAL_VERSION}" >> $GITHUB_OUTPUT
4549
46-
# Add more "Construct Version String" steps here for RC, Final, etc. in the future
50+
- name: Update Version in Files
51+
shell: bash
52+
run: find . -type f -name "*.py" -exec sed -i "s/<unreleased>/${{ steps.versioning.outputs.VERSION_STRING }}/g" {} +
4753

48-
###################################################################
49-
# JOB 2: Call the build workflows to run in parallel
50-
###################################################################
51-
build_windows:
52-
name: Build Windows Artifact
53-
needs: prepare # This job waits for the version calculation to finish
54-
uses: ./.github/workflows/build-windows.yml
55-
with:
56-
version_string: ${{ needs.prepare.outputs.version_string }}
57-
artifact_name: windows-build-${{ needs.prepare.outputs.version_string }}
58-
59-
build_linux:
60-
name: Build Linux & Debian Artifacts
61-
needs: prepare
62-
uses: ./.github/workflows/build-linux.yml
63-
with:
64-
version_string: ${{ needs.prepare.outputs.version_string }}
65-
artifact_name_linux: linux-build-${{ needs.prepare.outputs.version_string }}
66-
artifact_name_deb: debian-build-${{ needs.prepare.outputs.version_string }}```
54+
- name: Build Binary
55+
run: make ${{ runner.os == 'Windows' && 'win' || 'lin' }}
6756

68-
This complete, three-file setup is the robust and correct implementation of your build system. Once you commit and push these changes, please try running the `dev_build` again. It should now succeed on all platforms.
57+
- name: Upload Developer Artifact
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: dev-build-${{ runner.os }}-${{ steps.versioning.outputs.VERSION_STRING }}
61+
path: dist/*
62+
63+
######################################################################
64+
# JOB 2: RELEASE CANDIDATE BUILDS (On-demand from REL branches)
65+
######################################################################
66+
build_rc_release:
67+
name: Release Candidate Build
68+
# This job runs ONLY when you manually trigger it AND you are on a REL_* branch
69+
if: github.event_name == 'workflow_dispatch' && startsWith(github.ref_name, 'REL_')
70+
71+
# ... The steps for this job (versioning, building, creating a pre-release) will go here ...
72+
steps:
73+
- name: Placeholder for RC Build
74+
run: echo "RC build for branch ${{ github.ref_name }} would run here."
75+
76+
######################################################################
77+
# JOB 3: NIGHTLY BUILDS (Scheduled)
78+
######################################################################
79+
nightly_build:
80+
name: Nightly Build
81+
# This job ONLY runs on a schedule
82+
if: github.event_name == 'schedule'
83+
84+
# ... The steps for the nightly build will go here ...
85+
steps:
86+
- name: Placeholder for Nightly Build
87+
run: echo "Nightly build would run here."

0 commit comments

Comments
 (0)