-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (80 loc) · 2.01 KB
/
release.yml
File metadata and controls
89 lines (80 loc) · 2.01 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
# Linux
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: linux
goarch: 386
# macOS
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
# FreeBSD
- goos: freebsd
goarch: amd64
- goos: freebsd
goarch: arm64
# OpenBSD
- goos: openbsd
goarch: amd64
- goos: openbsd
goarch: arm64
# Windows
- goos: windows
goarch: amd64
- goos: windows
goarch: arm64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
VERSION="${GITHUB_REF_NAME}"
EXT=""
if [ "$GOOS" = "windows" ]; then EXT=".exe"; fi
BINARY="sear-${GOOS}-${GOARCH}${EXT}"
go build -trimpath -ldflags "-s -w -X main.version=${VERSION}" -o "${BINARY}" .
sha256sum "${BINARY}" > "${BINARY}.sha256"
- uses: actions/upload-artifact@v4
with:
name: sear-${{ matrix.goos }}-${{ matrix.goarch }}
path: |
sear-*
!sear-*.sha256
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Generate checksums
run: |
cd artifacts
sha256sum sear-* | grep -v '.sha256' > ../checksums.txt
- uses: softprops/action-gh-release@v2
with:
files: |
artifacts/sear-*
checksums.txt
generate_release_notes: true