-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (40 loc) · 1.07 KB
/
cd.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
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- arch: amd64
os: linux
- arch: arm64
os: linux
- arch: arm64
os: darwin
- arch: amd64
os: windows
ext: .exe
env:
BINARY_NAME: ${{ github.repository }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.ext }}
GOARCH: ${{ matrix.arch }}
GOOS: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: './go.mod'
- run: go build -o "$BINARY_NAME" -v -ldflags '-X main.Version=${{ github.ref_name }}'
- run: gh release upload ${{ github.ref_name }} "$BINARY_NAME"
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
release:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: gh release edit ${{ github.ref_name }} --prerelease=false --latest
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}