-
Notifications
You must be signed in to change notification settings - Fork 50
83 lines (72 loc) · 1.86 KB
/
release.yml
File metadata and controls
83 lines (72 loc) · 1.86 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
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- goos: linux
goarch: amd64
output: evo-linux-amd64
- goos: linux
goarch: arm64
output: evo-linux-arm64
- goos: darwin
goarch: amd64
output: evo-darwin-amd64
- goos: darwin
goarch: arm64
output: evo-darwin-arm64
- goos: windows
goarch: amd64
output: evo-windows-amd64.exe
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: "0"
run: |
set -euo pipefail
mkdir -p dist
go build -trimpath -ldflags "-s -w -X main.Version=${{ github.ref_name }}" -o "dist/${{ matrix.output }}" ./cmd/evo
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.output }}
path: dist/${{ matrix.output }}
if-no-files-found: error
release:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v4
with:
path: out
merge-multiple: true
- name: Generate checksums
run: |
set -euo pipefail
cd out
sha256sum evo-* > checksums.txt
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
out/evo-linux-amd64
out/evo-linux-arm64
out/evo-darwin-amd64
out/evo-darwin-arm64
out/evo-windows-amd64.exe
out/checksums.txt