Skip to content

Commit 8c322b8

Browse files
authored
Update blank.yml
1 parent 4b8a1be commit 8c322b8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/blank.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@ name: Build and Release
33
on:
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

913
jobs:
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
@@ -26,7 +32,6 @@ jobs:
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:
@@ -36,6 +41,8 @@ jobs:
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

0 commit comments

Comments
 (0)