Skip to content

Commit 52bd54f

Browse files
action
1 parent 10436a0 commit 52bd54f

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/build.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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

0 commit comments

Comments
 (0)