forked from juruen/rmapi
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (37 loc) · 1.14 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Release
on:
push:
tags:
- v*
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.23.1
uses: actions/setup-go@v5
with:
go-version: 1.23.1
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- run: echo "VERSION=`echo $(git describe --tags)`" >> $GITHUB_ENV
- name: Build Linux binary
run: go build -v -ldflags "-X 'github.com/juruen/rmapi/version.Version=${{ env.VERSION }}'" -o rmapi .
- name: Create tar
run: tar czvf rmapi-linuxx86-64.tar.gz rmapi
- name: Build MacOS binary
run: GOOS=darwin go build -v -o rmapi .
- name: Create zip
run: zip rmapi-macosx.zip rmapi
- name: Build Windows binary
run: GOOS=windows go build -v -o rmapi.exe .
- name: Create zip
run: zip rmapi-win64.zip rmapi.exe
- name: Release
uses: docker://softprops/action-gh-release
if: startsWith(github.ref, 'refs/tags/')
with:
files: rmapi-*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}