Skip to content

Commit 1f9796b

Browse files
Merge branch 'develop'
2 parents d5f750b + 8a66141 commit 1f9796b

File tree

7 files changed

+257
-78
lines changed

7 files changed

+257
-78
lines changed

.github/workflows/create-release.yml

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,71 +16,84 @@ on:
1616
default: patch
1717
required: true
1818

19+
permissions:
20+
contents: write
21+
pull-requests: write
22+
packages: write
23+
1924
jobs:
2025
validate_branch:
2126
runs-on: ubuntu-latest
22-
23-
# Expose the file path to downstream jobs
2427
outputs:
2528
version_json_path: ${{ steps.locate_version.outputs.file }}
26-
2729
steps:
28-
# Checkout the branch we’re releasing *from*
2930
- name: Checkout target branch
3031
uses: actions/checkout@v4
3132
with:
3233
fetch-depth: 1
3334
ref: ${{ inputs.target_branch }}
3435

35-
# Optional sanity check (keeps the job obvious when the ref is wrong)
36-
- name: Ensure target branch exists
36+
- name: Ensure target branch exists
3737
run: |
3838
if ! git rev-parse --verify --quiet "refs/heads/${{ inputs.target_branch }}"; then
3939
echo "::error::Ref '${{ inputs.target_branch }}' not found."
4040
exit 1
4141
fi
4242
43-
# Find version.json and emit its absolute path
4443
- name: Locate version.json
4544
id: locate_version
4645
shell: bash
4746
run: |
48-
# Search Git-tracked files first …
4947
REL_PATH=$(git ls-files --full-name '*version.json' | head -n1)
50-
51-
# … fall back to a filesystem search for untracked files (optional)
5248
if [[ -z "$REL_PATH" ]]; then
5349
REL_PATH=$(find . -type f -name version.json | head -n1 | sed 's|^\./||')
5450
fi
55-
5651
if [[ -z "$REL_PATH" ]]; then
5752
echo "::error::version.json not found on branch '${{ inputs.target_branch }}'."
58-
tree -L 2 -C || true
5953
exit 1
6054
fi
55+
echo "file=$GITHUB_WORKSPACE/$REL_PATH" >> "$GITHUB_OUTPUT"
6156
62-
ABS_PATH="$GITHUB_WORKSPACE/$REL_PATH"
63-
echo "Found version.json at: $ABS_PATH"
64-
65-
# Pass the path to other jobs
66-
echo "file=$ABS_PATH" >> "$GITHUB_OUTPUT"
67-
68-
prepare:
57+
prepare-main:
6958
needs: validate_branch
59+
if: ${{ inputs.target_branch == 'main'}}
7060
uses: Stillpoint-Software/shared-workflows/.github/workflows/nbgv_prepare_release.yml@main
7161
with:
7262
target_branch: ${{ inputs.target_branch }}
7363
increment: ${{ inputs.increment }}
7464
version_file_path: ${{ needs.validate_branch.outputs.version_json_path }}
7565
secrets: inherit
7666

77-
publish:
78-
needs: prepare
67+
prepare-develop:
68+
needs: validate_branch
69+
if: ${{ inputs.target_branch == 'develop' }}
70+
uses: Stillpoint-Software/shared-workflows/.github/workflows/nbgv_prepare_release.yml@develop
71+
with:
72+
target_branch: ${{ inputs.target_branch }}
73+
increment: ${{ inputs.increment }}
74+
version_file_path: ${{ needs.validate_branch.outputs.version_json_path }}
75+
secrets: inherit
76+
77+
publish-main:
78+
needs: prepare-main
79+
if: ${{ inputs.target_branch == 'main' || inputs.target_branch == 'master' }}
7980
uses: Stillpoint-Software/shared-workflows/.github/workflows/nbgv_dotnet_pack.yml@main
8081
with:
81-
checkout_ref: ${{ needs.prepare.outputs.release_branch }}
82-
build_configuration: ${{ inputs.target_branch == 'develop' && 'Develop' || 'Release' }}
82+
checkout_ref: ${{ needs.prepare-main.outputs.release_branch }}
83+
build_configuration: Release
84+
push_after_pack: true
85+
force_dev_prerelease: false
86+
secrets:
87+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
88+
89+
publish-develop:
90+
needs: prepare-develop
91+
if: ${{ inputs.target_branch == 'develop' }}
92+
uses: Stillpoint-Software/shared-workflows/.github/workflows/nbgv_dotnet_pack.yml@develop
93+
with:
94+
checkout_ref: ${{ needs.prepare-develop.outputs.release_branch }}
95+
build_configuration: Develop
8396
push_after_pack: true
84-
force_dev_prerelease: ${{ inputs.target_branch == 'develop' }}
97+
force_dev_prerelease: true
8598
secrets:
8699
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Create Test Report
2+
on:
3+
workflow_run:
4+
workflows: ["Test"]
5+
types: [completed]
6+
branches: [main, develop]
7+
8+
workflow_dispatch:
9+
inputs:
10+
test_run_id:
11+
description: "Run ID of the completed Test workflow (see the URL)"
12+
required: true
13+
type: string
14+
branch:
15+
description: "Branch that Test was run on"
16+
required: true
17+
type: choice
18+
options: [main, develop]
19+
default: develop
20+
21+
permissions:
22+
contents: read
23+
actions: read
24+
checks: write
25+
26+
jobs:
27+
discover-auto:
28+
runs-on: ubuntu-latest
29+
if: ${{ github.event_name == 'workflow_run' }} # ← then the condition
30+
outputs:
31+
branch_name: ${{ steps.meta.outputs.branch }}
32+
sha: ${{ steps.meta.outputs.sha }}
33+
run_id: ${{ steps.meta.outputs.run_id }}
34+
steps:
35+
- id: meta
36+
run: |
37+
echo "branch=${{ github.event.workflow_run.head_branch }}" >> "$GITHUB_OUTPUT"
38+
echo "sha=${{ github.event.workflow_run.head_sha }}" >> "$GITHUB_OUTPUT"
39+
echo "run_id=${{ github.event.workflow_run.id }}" >> "$GITHUB_OUTPUT"
40+
41+
report-auto-main:
42+
needs: discover-auto
43+
if: ${{ github.event_name == 'workflow_run' &&
44+
needs.discover-auto.result == 'success' &&
45+
needs.discover-auto.outputs.branch_name == 'main' }}
46+
uses: Stillpoint-Software/shared-workflows/.github/workflows/test-report.yml@main
47+
with:
48+
test_run_id: ${{ needs.discover-auto.outputs.run_id }}
49+
branch: main
50+
secrets: inherit
51+
52+
report-auto-develop:
53+
needs: discover-auto
54+
if: ${{ github.event_name == 'workflow_run' &&
55+
needs.discover-auto.result == 'success' &&
56+
needs.discover-auto.outputs.branch_name == 'develop' }}
57+
uses: Stillpoint-Software/shared-workflows/.github/workflows/test-report.yml@develop
58+
with:
59+
test_run_id: ${{ needs.discover-auto.outputs.run_id }}
60+
branch: develop
61+
secrets: inherit
62+
63+
report-manual-main:
64+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.branch == 'main' }}
65+
uses: Stillpoint-Software/shared-workflows/.github/workflows/test-report.yml@main
66+
with:
67+
test_run_id: ${{ inputs.test_run_id }}
68+
branch: main
69+
secrets: inherit
70+
71+
report-manual-develop:
72+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.branch == 'develop' }}
73+
uses: Stillpoint-Software/shared-workflows/.github/workflows/test-report.yml@develop
74+
with:
75+
test_run_id: ${{ inputs.test_run_id }}
76+
branch: develop
77+
secrets: inherit

.github/workflows/format.yml

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,68 @@
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:
127
types: [opened, edited, synchronize, reopened]
13-
branches:
14-
- main
15-
- develop
8+
branches: [main, develop]
9+
10+
workflow_run:
11+
workflows: [Create Prerelease, Create Release]
12+
types: [requested]
13+
branches: [main, develop]
14+
15+
permissions:
16+
contents: read
17+
actions: read
1618

1719
jobs:
18-
format:
20+
discover:
21+
runs-on: ubuntu-latest
22+
outputs:
23+
branch_name: ${{ steps.set_branch.outputs.branch_name }}
24+
25+
steps:
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+
show-branch:
45+
needs: discover
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Print branch_name from discover
49+
run: |
50+
echo "::notice title=branch_name::'${{ needs.discover.outputs.branch_name }}'"
51+
52+
format-main:
53+
needs: discover
54+
if: ${{ needs.discover.outputs.branch_name == 'main' }}
1955
uses: Stillpoint-Software/shared-workflows/.github/workflows/format.yml@main
2056
with:
2157
dotnet_version: "9.0.x"
2258
secrets:
2359
GH_TOKEN: ${{ secrets.GH_TOKEN }}
2460

25-
26-
61+
format-develop:
62+
needs: discover
63+
if: ${{ needs.discover.outputs.branch_name == 'develop' }}
64+
uses: Stillpoint-Software/shared-workflows/.github/workflows/format.yml@develop
65+
with:
66+
dotnet_version: "9.0.x"
67+
secrets:
68+
GH_TOKEN: ${{ secrets.GH_TOKEN }}

.github/workflows/issue-branch.yml

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,45 @@
11
name: Create Issue Branch
22

33
on:
4-
# The issue.opened event below is only needed for the "immediate" mode.
5-
# The issue.assigned event below is only needed for the default ("auto") mode.
64
issues:
7-
types: [ opened, assigned ]
8-
# The issue_comment.created event below is only needed for the ChatOps mode.
5+
types: [ opened, assigned ] # “immediate” / “auto” modes
96
issue_comment:
10-
types: [ created ]
11-
# The pull_request events below are only needed for pull-request related features.
7+
types: [ created ] # ChatOps mode
128
pull_request:
13-
types: [ opened, closed ]
9+
types: [ opened, closed ] # PR-related features
10+
11+
permissions:
12+
contents: read
13+
issues: write
14+
pull-requests: write
1415

1516
jobs:
16-
create_issue_branch_job:
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.outputs.branch_name == 'main'}}
1734
uses: Stillpoint-Software/shared-workflows/.github/workflows/create-issue-branch.yml@main
1835
secrets:
19-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
38+
create-issue-branch-develop:
39+
needs: discover
40+
if: ${{ needs.discover.outputs.branch_name == 'develop' }}
41+
uses: Stillpoint-Software/shared-workflows/.github/workflows/create-issue-branch.yml@develop
42+
secrets:
43+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
45+

.github/workflows/test-report.yml

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

0 commit comments

Comments
 (0)