Skip to content

Commit 62f9f16

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

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+
push:
6+
tags:
7+
- '**'
8+
9+
jobs:
10+
build-and-release:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
- name: Checkout the repository
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: '1.21'
23+
cache-dependency-path: teamup-rocketchat-bot/go.sum
24+
25+
- name: Build the binary for linux/amd64
26+
working-directory: teamup-rocketchat-bot
27+
run: |
28+
GOARCH=amd64 GOOS=linux go build -o build/linux-amd64-${{ github.ref_name }} .
29+
echo "binary created with filename $(ls build/)"
30+
31+
- name: Create GitHub release and upload binary
32+
uses: softprops/action-gh-release@v2
33+
with:
34+
files: teamup-rocketchat-bot/build/linux-amd64-${{ github.ref_name }}
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)