Skip to content

Commit 12e1a6b

Browse files
Updated workflows to use the new system
1 parent fae5a3e commit 12e1a6b

17 files changed

+262
-646
lines changed

.github/workflows/create-release.yml

Lines changed: 0 additions & 99 deletions
This file was deleted.

.github/workflows/create-test-report.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Create Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
mode:
7+
description: |
8+
How to set the version:
9+
- explicit: set to a specific value (e.g., 1.3-alpha)
10+
- bump: bump major/minor/patch from current SimpleVersion and apply optional prerelease
11+
- auto: policy-based (develop->next minor -alpha; hotfix/*->next patch -alpha; main/vX.Y->stable)
12+
type: choice
13+
options: [auto, bump, explicit]
14+
default: auto
15+
version:
16+
description: "When mode=explicit: exact version (e.g., 1.3-alpha, 1.2.3, 1.4.0-rc)"
17+
type: string
18+
default: ""
19+
increment:
20+
description: "When mode=bump: major | minor | patch"
21+
type: choice
22+
options: [major, minor, patch]
23+
default: patch
24+
prerelease:
25+
description: "When mode=bump: prerelease suffix WITHOUT leading dash (e.g., alpha, beta, rc). Leave blank for stable."
26+
type: string
27+
default: ""
28+
29+
permissions:
30+
contents: write
31+
pull-requests: write
32+
packages: write
33+
34+
run-name: "Create Release · ${{ inputs.mode }} · ${{ github.ref_name }}"
35+
36+
jobs:
37+
validate-inputs:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Check conditional requirements
41+
run: |
42+
set -euo pipefail
43+
MODE='${{ inputs.mode }}'
44+
VERSION='${{ inputs.version }}'
45+
INCR='${{ inputs.increment }}'
46+
if [[ "$MODE" == "explicit" && -z "$VERSION" ]]; then
47+
echo "? mode=explicit requires 'version' (e.g., 1.3-alpha)."; exit 1
48+
fi
49+
if [[ "$MODE" == "bump" && -z "$INCR" ]]; then
50+
echo "? mode=bump requires 'increment' (major|minor|patch)."; exit 1
51+
fi
52+
echo "? inputs look good."
53+
54+
set-version:
55+
needs: validate-inputs
56+
uses: Stillpoint-Software/shared-workflows/.github/workflows/set_version.yml@main
57+
with:
58+
target_branch: ${{ github.ref_name }}
59+
mode: ${{ inputs.mode }}
60+
version: ${{ inputs.version }}
61+
increment: ${{ inputs.increment }}
62+
prerelease: ${{ inputs.prerelease }}
63+
secrets: inherit
64+
65+
create-release:
66+
needs: set-version
67+
uses: Stillpoint-Software/shared-workflows/.github/workflows/prepare_release.yml@main
68+
with:
69+
target_branch: ${{ github.ref_name }}
70+
tag: ${{ needs.set-version.outputs.tag }}
71+
prerelease: ${{ needs.set-version.outputs.new_prerelease }}
72+
draft: true
73+
secrets:
74+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Create Test Report
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Run Tests"]
6+
types: [completed]
7+
branches: [main, develop]
8+
9+
permissions:
10+
contents: read
11+
actions: read
12+
checks: write
13+
14+
jobs:
15+
discover-auto:
16+
runs-on: ubuntu-latest
17+
if: ${{ github.event_name == 'workflow_run' }}
18+
outputs:
19+
branch_name: ${{ steps.meta.outputs.branch }}
20+
sha: ${{ steps.meta.outputs.sha }}
21+
run_id: ${{ steps.meta.outputs.run_id }}
22+
conclusion: ${{ steps.meta.outputs.conclusion }}
23+
steps:
24+
- id: meta
25+
run: |
26+
echo "branch=${{ github.event.workflow_run.head_branch }}" >> "$GITHUB_OUTPUT"
27+
echo "sha=${{ github.event.workflow_run.head_sha }}" >> "$GITHUB_OUTPUT"
28+
echo "run_id=${{ github.event.workflow_run.id }}" >> "$GITHUB_OUTPUT"
29+
echo "conclusion=${{ github.event.workflow_run.conclusion }}" >> "$GITHUB_OUTPUT"
30+
31+
report-auto:
32+
needs: discover-auto
33+
if: ${{ needs.discover-auto.outputs.conclusion != 'skipped' }}
34+
uses: Stillpoint-Software/shared-workflows/.github/workflows/test_report.yml@main
35+
with:
36+
test_run_id: ${{ needs.discover-auto.outputs.run_id }}
37+
branch: ${{ needs.discover-auto.outputs.branch_name }}
38+
sha: ${{ needs.discover-auto.outputs.sha }}
39+
secrets: inherit

.github/workflows/format.yml

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@ on:
77
types: [opened, edited, synchronize, reopened]
88
branches: [main, develop]
99

10-
# Run when Create Prerelease / Create Release start,
11-
# **but only if they run on main or develop**
1210
workflow_run:
1311
workflows: [Create Prerelease, Create Release]
1412
types: [requested]
15-
branches: [main, develop]
16-
13+
1714
permissions:
18-
contents: read
15+
contents: write
16+
pull-requests: write
1917
actions: read
2018

2119
jobs:
@@ -42,29 +40,13 @@ jobs:
4240
4341
echo "Detected branch: $CLEAN"
4442
echo "branch_name=$CLEAN" >> "$GITHUB_OUTPUT"
45-
46-
show-branch:
47-
needs: discover
48-
runs-on: ubuntu-latest
49-
steps:
50-
- name: Print branch_name from discover
51-
run: |
52-
echo "::notice title=branch_name::'${{ needs.discover.outputs.branch_name }}'"
53-
54-
format-main:
43+
44+
format:
5545
needs: discover
56-
if: ${{ needs.discover.outputs.branch_name == 'main' }}
46+
if: ${{ needs.discover.result == 'success' }}
5747
uses: Stillpoint-Software/shared-workflows/.github/workflows/format.yml@main
5848
with:
5949
dotnet_version: "9.0.x"
60-
secrets:
61-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
62-
63-
format-develop:
64-
needs: discover
65-
if: ${{ needs.discover.outputs.branch_name == 'develop' }}
66-
uses: Stillpoint-Software/shared-workflows/.github/workflows/format.yml@develop
67-
with:
68-
dotnet_version: "9.0.x"
69-
secrets:
70-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
50+
branch: ${{ needs.discover.outputs.branch_name }}
51+
secrets: inherit
52+

.github/workflows/issue-branch.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)