Skip to content

Commit 4a7703d

Browse files
committed
ci: add workflow to build and release binary on tag
1 parent cfcce38 commit 4a7703d

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build the binary and create release
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
tags:
8+
- '**'
9+
10+
jobs:
11+
build-and-release:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
16+
steps:
17+
- name: Checkout the repository
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: '1.21'
24+
25+
- name: Build the binary for linux/amd64
26+
working-directory: teamup-rocketchat-bot
27+
# run: GOARCH=amd64 GOOS=linux go build -o build/linux-amd64-${{ github.ref_name }} .
28+
run: GOARCH=amd64 GOOS=linux go build -o build/linux-amd64 .
29+
30+
- name: Create GitHub release and upload binary
31+
uses: softprops/action-gh-release@v2
32+
with:
33+
# files: teamup-rocketchat-bot/build/linux-amd64-${{ github.ref_name }}
34+
files: teamup-rocketchat-bot/build/linux-amd64
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)