File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Build and Upload Go Binary
1+ name : Build and Release Go Binary
22
33on :
44 push :
5- branches : [main]
5+ tags :
6+ - ' v*'
67
78jobs :
89 build :
@@ -17,13 +18,11 @@ jobs:
1718
1819 - name : Build binary
1920 run : |
20- mkdir -p releases
21- go build -o releases/commit-msg-go commit-msg.go
21+ go build -o commit-msg-go commit-msg.go
2222
23- - name : Commit and push binary
24- run : |
25- git config user.name "github-actions[bot]"
26- git config user.email "github-actions[bot]@users.noreply.github.com"
27- git add releases/commit-msg-go
28- git commit -m "ci: update commit-msg-go binary [skip ci]" || exit 0
29- git push
23+ - name : Upload Release Asset
24+ uses : softprops/action-gh-release@v2
25+ with :
26+ files : commit-msg-go
27+ env :
28+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -11,4 +11,12 @@ install-hook:
1111 curl -fsSL https://raw.githubusercontent.com/inem/dotdotdot/main/install.sh | sh
1212
1313build :
14- go build -o release/commit-msg-go commit-msg.go
14+ go build -o release/commit-msg-go commit-msg.go
15+
16+ release
17+ git tag v0.0.$(ARGS)
18+ git push origin v0.0.$(ARGS)
19+
20+ ARGS = $(filter-out $@ ,$(MAKECMDGOALS ) )
21+ % :
22+ @:
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ curl -fsSL "$HOOK_URL" -o "$HOOK_PATH"
1616chmod +x " $HOOK_PATH "
1717echo " Hook installed to $HOOK_PATH "
1818
19- echo " Downloading Go binary..."
19+ echo " Downloading Go binary from GitHub Releases ..."
2020curl -fsSL " $BIN_URL " -o " $BIN_PATH "
2121chmod +x " $BIN_PATH "
2222echo " Binary installed to $BIN_PATH "
You can’t perform that action at this time.
0 commit comments