Skip to content

Commit 543b011

Browse files
committed
GitHub Actions: run workflow on release
1 parent c40ac2d commit 543b011

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ on:
1313
branches: [ 'master', 'release/**' ]
1414
pull_request:
1515
branches: [ 'master', 'release/**' ]
16-
tags:
17-
- 'v*'
16+
release:
17+
types: [published]
1818

1919
concurrency:
2020
group: ${{ github.workflow }}-${{ github.ref }}
@@ -107,7 +107,7 @@ jobs:
107107
Write-Error "Version prefix from git release tag '$versionPrefix' does not match version prefix '$configuredVersionPrefix' stored in Directory.Build.props."
108108
# To recover from this:
109109
# - Delete the GitHub release
110-
# - Run: git push --delete the-invalid-tag-name
110+
# - Run: git push --delete origin the-invalid-tag-name
111111
# - Adjust JsonApiDotNetCoreVersionPrefix in Directory.Build.props, commit and push
112112
# - Recreate the GitHub release
113113
}
@@ -252,7 +252,7 @@ jobs:
252252
Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash in pull request."
253253
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --max-runs=5 --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash --fail-on-diff --print-diff
254254
- name: CleanupCode (on branch)
255-
if: github.event_name == 'push'
255+
if: github.event_name == 'push' || github.event_name == 'release'
256256
shell: pwsh
257257
run: |
258258
Write-Output "Running code cleanup on all files."
@@ -270,7 +270,7 @@ jobs:
270270
- name: Download artifacts
271271
uses: actions/download-artifact@v3
272272
- name: Publish to GitHub Packages
273-
if: github.event_name == 'push'
273+
if: github.event_name == 'push' || github.event_name == 'release'
274274
env:
275275
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
276276
shell: pwsh
@@ -286,7 +286,7 @@ jobs:
286286
publish_dir: ./documentation
287287
commit_message: 'Auto-generated documentation from'
288288
- name: Publish to NuGet
289-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
289+
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v')
290290
env:
291291
NUGET_ORG_API_KEY: ${{ secrets.NUGET_ORG_API_KEY }}
292292
shell: pwsh

0 commit comments

Comments
 (0)