File tree Expand file tree Collapse file tree 2 files changed +42
-52
lines changed Expand file tree Collapse file tree 2 files changed +42
-52
lines changed Original file line number Diff line number Diff line change 1- name : Build
1+ name : Build and Release
22
33on :
44 push : {}
55 pull_request : {}
6+ workflow_dispatch :
67
78jobs :
89 build :
910 runs-on : ubuntu-22.04
1011 steps :
1112 - name : Checkout code
1213 uses : actions/checkout@v4
14+ with :
15+ fetch-depth : 0
1316
1417 - name : Set up Go
1518 uses : actions/setup-go@v4
6972 with :
7073 name : built-binaries
7174 path : bin/
72- retention-days : 5
75+ retention-days : 5
76+
77+ - name : Get tag version (if tag push)
78+ if : startsWith(github.ref, 'refs/tags/')
79+ id : get_version
80+ run : |
81+ TAG_VERSION=${GITHUB_REF#refs/tags/}
82+ echo "tag_version=$TAG_VERSION" >> $GITHUB_OUTPUT
83+ echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV
84+
85+ release :
86+ if : startsWith(github.ref, 'refs/tags/')
87+ needs : [build]
88+ runs-on : ubuntu-22.04
89+ steps :
90+ - name : Download artifacts
91+ uses : actions/download-artifact@v4
92+ with :
93+ name : built-binaries
94+ path : bin
95+
96+ - name : Create GitHub Release
97+ uses : softprops/action-gh-release@v2
98+ with :
99+ tag_name : ${{ needs.build.outputs.tag_version }}
100+ name : Release ${{ needs.build.outputs.tag_version }}
101+ body : |
102+ ## Pre-built binaries
103+ - Static libraries (.a files)
104+ - Header files (.h files)
105+
106+ Built from tag: ${{ needs.build.outputs.tag_version }}
107+ files : |
108+ bin/*.a
109+ bin/*.h
110+ generate_release_notes : true
111+ draft : false
112+ prerelease : false
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments