Skip to content

Commit 1e9ac42

Browse files
Merge pull request #70 from Stillpoint-Software/develop
Develop
2 parents 1d76650 + 6f7d768 commit 1e9ac42

30 files changed

+410
-728
lines changed

.github/workflows/create-release.yml

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

.github/workflows/create_release.yml

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: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,52 @@
11
name: Format
22

3-
on:
3+
on:
44
push:
5-
workflow_run:
6-
workflows:
7-
- Create Prerelease
8-
- Create Release
9-
types: [requested]
105
workflow_dispatch:
116
pull_request:
12-
types: [opened,edited,synchronize,reopened]
13-
branches:
14-
- main
15-
- develop
7+
types: [opened, edited, synchronize, reopened]
8+
branches: [main, develop]
169

10+
workflow_run:
11+
workflows: [Create Prerelease, Create Release]
12+
types: [requested]
13+
1714
permissions:
18-
contents: write
19-
20-
env:
21-
DOTNET_VERSION: "9.0.x"
15+
contents: write
16+
pull-requests: write
17+
actions: read
2218

2319
jobs:
24-
format:
20+
discover:
2521
runs-on: ubuntu-latest
22+
outputs:
23+
branch_name: ${{ steps.set_branch.outputs.branch_name }}
2624

2725
steps:
28-
- name: Checkout Code
29-
uses: actions/checkout@v4
30-
31-
- name: Setup .NET
32-
uses: actions/setup-dotnet@v4
33-
with:
34-
dotnet-version: ${{ env.DOTNET_VERSION }}
35-
36-
- name: Format
37-
run: dotnet format
38-
39-
- name: Update Styles
40-
continue-on-error: true
41-
run: |
42-
git config --global user.name 'github-actions'
43-
git config --global user.email '[email protected]'
44-
git commit -am "Updated code formatting to match rules in .editorconfig"
45-
git push
46-
26+
- id: set_branch
27+
shell: bash
28+
run: |
29+
# 1. Pick the raw branch/ref for each trigger type
30+
if [[ "${{ github.event_name }}" == "workflow_run" ]]; then
31+
RAW='${{ github.event.workflow_run.head_branch }}'
32+
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
33+
RAW='${{ github.event.pull_request.base.ref }}'
34+
else
35+
RAW='${{ github.ref }}'
36+
fi
37+
38+
# 2. Strip the refs/heads/ prefix if present
39+
CLEAN="${RAW#refs/heads/}"
40+
41+
echo "Detected branch: $CLEAN"
42+
echo "branch_name=$CLEAN" >> "$GITHUB_OUTPUT"
43+
44+
format:
45+
needs: discover
46+
if: ${{ needs.discover.result == 'success' }}
47+
uses: Stillpoint-Software/shared-workflows/.github/workflows/format.yml@main
48+
with:
49+
dotnet_version: "9.0.x"
50+
branch: ${{ needs.discover.outputs.branch_name }}
51+
secrets: inherit
52+

.github/workflows/issue-branch.yml

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

.github/workflows/issue_branch.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Create Issue Branch
2+
3+
on:
4+
issues:
5+
types: [opened, assigned] # “immediate” / “auto” modes
6+
issue_comment:
7+
types: [created] # ChatOps mode
8+
pull_request:
9+
types: [opened, closed] # PR-related features
10+
11+
permissions:
12+
contents: read
13+
issues: write
14+
pull-requests: write
15+
16+
jobs:
17+
discover:
18+
runs-on: ubuntu-latest
19+
outputs:
20+
branch_name: ${{ steps.set_branch.outputs.branch_name }}
21+
steps:
22+
- name: Determine target branch
23+
id: set_branch
24+
run: echo "branch_name=${BRANCH}" >> "$GITHUB_OUTPUT"
25+
env:
26+
BRANCH: >-
27+
${{ github.event_name == 'pull_request' &&
28+
github.event.pull_request.base.ref ||
29+
'main' }}
30+
31+
create-issue-branch-main:
32+
needs: discover
33+
if: ${{ needs.discover.result == 'success' }}
34+
uses: Stillpoint-Software/shared-workflows/.github/workflows/issue_branch.yml@main
35+
secrets: inherit

.github/workflows/pack_publish.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Pack and Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
packages: write
11+
12+
jobs:
13+
set-config:
14+
uses: Stillpoint-Software/shared-workflows/.github/workflows/determine_build_configuration.yml@main
15+
with:
16+
trigger: release
17+
target_branch: ${{ github.event.release.target_commitish }}
18+
override_build_configuration: ''
19+
prerelease: ${{ github.event.release.prerelease }} # true/false from the release
20+
21+
publish:
22+
needs: set-config
23+
uses: Stillpoint-Software/shared-workflows/.github/workflows/pack_and_publish.yml@main
24+
with:
25+
build_configuration: ${{ needs.set-config.outputs.build_configuration }}
26+
secrets:
27+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

0 commit comments

Comments
 (0)