Skip to content

Commit 8cdb0ea

Browse files
committed
add CI build test branch to workflow
This just avoids needing to run build tests on the main `develop` branch.
1 parent e76e995 commit 8cdb0ea

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

.github/workflows/build-smapi.yml

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- "[0-9]+.[0-9]+.[0-9]+" # stable version tag
77
branches:
88
- develop
9+
- build-test
910

1011
jobs:
1112
build_and_release:
@@ -20,28 +21,6 @@ jobs:
2021
with:
2122
fetch-depth: 0
2223

23-
- name: Get trigger type # possible values: tag, dev-branch
24-
id: trigger-type
25-
shell: pwsh
26-
run: |
27-
# If we ever decide to add manual workflow runs, this will need to be reworked.
28-
29-
if ('${{github.ref_type}}' -eq 'tag') {
30-
Write-Host 'Building regular release.'
31-
'trigger_type=tag' | Out-File -FilePath $env:GITHUB_OUTPUT -Append
32-
}
33-
elseif ('${{github.ref_name}}' -eq 'develop') {
34-
Write-Host 'Building in-development release.'
35-
'trigger_type=dev-branch' | Out-File -FilePath $env:GITHUB_OUTPUT -Append
36-
}
37-
else {
38-
Write-Error 'Ran into an unexpected trigger type. Aborting.'
39-
Write-Host 'Debug info:'
40-
Write-Host 'ref_type: ${{github.ref_type}}'
41-
Write-Host 'ref_name: ${{github.ref_name}}'
42-
exit 1
43-
}
44-
4524
- name: Get SMAPI assembly version
4625
id: smapi-version
4726
shell: pwsh
@@ -72,7 +51,7 @@ jobs:
7251
Write-Host "Version: $major.$minor.$patch"
7352
7453
- name: Verify SMAPI assembly version matches tag
75-
if: steps.trigger-type.outputs.trigger_type == 'tag'
54+
if: github.ref_type == 'tag'
7655
shell: pwsh
7756
run: |
7857
if ($env:VERSION -ne '${{github.ref_name}}') {
@@ -84,7 +63,7 @@ jobs:
8463
}
8564
8665
- name: Update SMAPI assembly version
87-
if: steps.trigger-type.outputs.trigger_type == 'dev-branch'
66+
if: github.ref_type != 'tag'
8867
shell: pwsh
8968
run: |
9069
$updatedPatch = [int]${{steps.smapi-version.outputs.smapi_patch}} + 1
@@ -129,7 +108,7 @@ jobs:
129108

130109
- name: Create GitHub release
131110
uses: ncipollo/release-action@v1
132-
if: steps.trigger-type.outputs.trigger_type == 'tag'
111+
if: github.ref_type == 'tag'
133112
with:
134113
artifacts: 'bin/SMAPI-${{env.VERSION}}*.zip'
135114
token: '${{secrets.GITHUB_TOKEN}}'

0 commit comments

Comments
 (0)