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
2
2
3
3
on :
4
4
push : {}
5
5
pull_request : {}
6
+ workflow_dispatch :
6
7
7
8
jobs :
8
9
build :
9
10
runs-on : ubuntu-22.04
10
11
steps :
11
12
- name : Checkout code
12
13
uses : actions/checkout@v4
14
+ with :
15
+ fetch-depth : 0
13
16
14
17
- name : Set up Go
15
18
uses : actions/setup-go@v4
69
72
with :
70
73
name : built-binaries
71
74
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