File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -3,12 +3,18 @@ name: Build and Release
33on :
44 push :
55 branches :
6- - main # Runs when pushing to main branch
6+ - main # Runs build on push to main
77 pull_request :
8+ # Trigger release only on tag push
9+ push :
10+ tags :
11+ - ' v*.*.*' # Example: v1.0.0, v2.1.3, etc.
812
913jobs :
1014 build :
1115 runs-on : ubuntu-latest
16+ # Run this job on push to main or pull requests
17+ if : github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
1218
1319 steps :
1420 - name : Checkout repository
2632 mv JC-sdhash SDhash # Rename the output binary
2733 ls -lah # List files to verify the build
2834
29-
3035 - name : Create release artifact
3136 uses : actions/upload-artifact@v4
3237 with :
3641 release :
3742 needs : build
3843 runs-on : ubuntu-latest
44+ # Run this job only when a tag is pushed
45+ if : startsWith(github.ref, 'refs/tags/v')
3946
4047 steps :
4148 - name : Checkout repository
You can’t perform that action at this time.
0 commit comments