|
6 | 6 | - "[0-9]+.[0-9]+.[0-9]+" # stable version tag |
7 | 7 | branches: |
8 | 8 | - develop |
| 9 | + - build-test |
9 | 10 |
|
10 | 11 | jobs: |
11 | 12 | build_and_release: |
|
20 | 21 | with: |
21 | 22 | fetch-depth: 0 |
22 | 23 |
|
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 | | -
|
45 | 24 | - name: Get SMAPI assembly version |
46 | 25 | id: smapi-version |
47 | 26 | shell: pwsh |
|
72 | 51 | Write-Host "Version: $major.$minor.$patch" |
73 | 52 |
|
74 | 53 | - name: Verify SMAPI assembly version matches tag |
75 | | - if: steps.trigger-type.outputs.trigger_type == 'tag' |
| 54 | + if: github.ref_type == 'tag' |
76 | 55 | shell: pwsh |
77 | 56 | run: | |
78 | 57 | if ($env:VERSION -ne '${{github.ref_name}}') { |
|
84 | 63 | } |
85 | 64 |
|
86 | 65 | - name: Update SMAPI assembly version |
87 | | - if: steps.trigger-type.outputs.trigger_type == 'dev-branch' |
| 66 | + if: github.ref_type != 'tag' |
88 | 67 | shell: pwsh |
89 | 68 | run: | |
90 | 69 | $updatedPatch = [int]${{steps.smapi-version.outputs.smapi_patch}} + 1 |
@@ -129,7 +108,7 @@ jobs: |
129 | 108 |
|
130 | 109 | - name: Create GitHub release |
131 | 110 | uses: ncipollo/release-action@v1 |
132 | | - if: steps.trigger-type.outputs.trigger_type == 'tag' |
| 111 | + if: github.ref_type == 'tag' |
133 | 112 | with: |
134 | 113 | artifacts: 'bin/SMAPI-${{env.VERSION}}*.zip' |
135 | 114 | token: '${{secrets.GITHUB_TOKEN}}' |
|
0 commit comments