Skip to content

Commit 6311db7

Browse files
committed
Only publish crate when a release tag is pushed
1 parent 836f537 commit 6311db7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
branches:
66
- main
77
- release-*
8+
tags:
9+
- v*.*.*
810
pull_request:
911
branches:
1012
- main
@@ -148,5 +150,6 @@ jobs:
148150
override: true
149151
- uses: katyo/publish-crates@v2
150152
with:
151-
dry-run: ${{ github.event_name != 'push' }}
153+
# Only do an actual publish if this is a push to a release tag. Otherwise, do a dry run.
154+
dry-run: ${{ !(github.event_name == 'push' && github.ref_type == 'tag') }}
152155
ignore-unpublished-changes: true

0 commit comments

Comments
 (0)