-
Notifications
You must be signed in to change notification settings - Fork 6
79 lines (65 loc) · 2.84 KB
/
Copy pathrelease.yml
File metadata and controls
79 lines (65 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# .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
outputs:
version_string: ${{ steps.versioning.outputs.VERSION_STRING }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Construct Dev Version String via GitHub API
id: versioning
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
echo "--- Start Version Construction ---"
BRANCH_NAME="${{ github.ref_name }}"
echo "1. Branch Name: $BRANCH_NAME"
TICKET_NUM=$(echo "$BRANCH_NAME" | grep -oP 'TKT_[0-9]+' | sed 's/TKT_//')
echo "2. Parsed TICKET_NUM: $TICKET_NUM"
# Use the GitHub CLI to get the milestone title for the ticket
MILESTONE_TITLE=$(gh issue view "$TICKET_NUM" --json milestone --jq '.milestone.title')
echo "3. Fetched Milestone Title from API: $MILESTONE_TITLE"
# Parse the base version from the Milestone title
BASE_VERSION=$(echo "$MILESTONE_TITLE" | grep -oP 'REL_[0-9.]+' | sed 's/REL_//')
echo "4. Parsed BASE_VERSION: $BASE_VERSION"
BRANCH_BUILD_NUM=$(git rev-list --count HEAD)
echo "5. Parsed BRANCH_BUILD_NUM (Commit Count): $BRANCH_BUILD_NUM"
GLOBAL_BUILD_NUM="${{ github.run_number }}"
echo "6. Parsed GLOBAL_BUILD_NUM (Run Number): $GLOBAL_BUILD_NUM"
FINAL_VERSION="${BASE_VERSION}_dev${TICKET_NUM}.${BRANCH_BUILD_NUM}_${GLOBAL_BUILD_NUM}"
echo "7. Assembled FINAL_VERSION: $FINAL_VERSION"
echo "--- End Version Construction ---"
echo "VERSION_STRING=${FINAL_VERSION}" >> $GITHUB_OUTPUT
############################################################
# JOB 2: Run the actual builds by calling the reusable workflows
############################################################
build_binaries:
name: Build Binaries
needs: call_builds
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 }}