File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Release
2+
3+ on :
4+ push :
5+ # Trigger the workflow on a push to the `main` branch or when a tag is created
6+ branches :
7+ - " main"
8+ tags :
9+ - " v*" # This will trigger for tags that start with "v" (e.g., v1.0, v1.1)
10+
11+ jobs :
12+ build :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - name : Checkout code
17+ uses : actions/checkout@v4
18+
19+ - name : Set up Go
20+ uses : actions/setup-go@v4
21+ with :
22+ go-version : ' 1.24'
23+
24+ - name : Build binary
25+ run : |
26+ TAG_NAME=$(echo ${GITHUB_REF} | sed 's/refs\/tags\///')
27+ echo "Building for tag: $TAG_NAME"
28+ make build
29+
30+ - name : Upload binary as artifact
31+ if : startsWith(github.ref, 'refs/tags/')
32+ uses : actions/upload-artifact@v3
33+ with :
34+ name : gateway-${GITHUB_REF##*/}
35+ path : ./build/gateway # Replace this with the actual path to your binary
You can’t perform that action at this time.
0 commit comments