-
Notifications
You must be signed in to change notification settings - Fork 3
59 lines (47 loc) · 1.89 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
52
53
54
55
56
57
58
59
name: Release Build
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.x'
- name: Build Binaries
run: |
mkdir -p release
# Linux (64-bit)
GOOS=linux GOARCH=amd64 go build -o release/zscan-linux-amd64 cmd/main.go
cd release && tar -czf zscan-linux-amd64.tar.gz zscan-linux-amd64 && cd ..
# Linux (ARM64)
GOOS=linux GOARCH=arm64 go build -o release/zscan-linux-arm64 cmd/main.go
cd release && tar -czf zscan-linux-arm64.tar.gz zscan-linux-arm64 && cd ..
# Windows (64-bit)
GOOS=windows GOARCH=amd64 go build -o release/zscan-windows-amd64.exe cmd/main.go
cd release && zip zscan-windows-amd64.zip zscan-windows-amd64.exe && cd ..
# macOS (64-bit)
GOOS=darwin GOARCH=amd64 go build -o release/zscan-darwin-amd64 cmd/main.go
cd release && tar -czf zscan-darwin-amd64.tar.gz zscan-darwin-amd64 && cd ..
# macOS (ARM64/M1)
GOOS=darwin GOARCH=arm64 go build -o release/zscan-darwin-arm64 cmd/main.go
cd release && tar -czf zscan-darwin-arm64.tar.gz zscan-darwin-arm64 && cd ..
# Generate checksums
cd release && sha256sum zscan-* > checksums.txt && cd ..
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
release/zscan-linux-amd64.tar.gz
release/zscan-linux-arm64.tar.gz
release/zscan-windows-amd64.zip
release/zscan-darwin-amd64.tar.gz
release/zscan-darwin-arm64.tar.gz
release/checksums.txt
generate_release_notes: true