-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.85 KB
/
Copy pathrelease.yml
File metadata and controls
56 lines (46 loc) · 1.85 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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Vet
run: go vet ./...
- name: Test
run: go test ./... -count=1
# CGO_ENABLED=0 -> fully static binaries (no libc dependency, run on
# any Linux). -s -w strips the symbol table and DWARF: ~25-30%
# smaller artifacts. Go panic stack traces survive (they use the
# embedded pclntab, not ELF/DWARF) — only interactive debuggers
# (delve/gdb) lose symbols, which we never run against a release.
- name: Build binaries
env:
CGO_ENABLED: 0
run: |
VERSION=${GITHUB_REF#refs/tags/}
LDFLAGS="-s -w -X main.version=$VERSION"
GOOS=linux GOARCH=amd64 go build -trimpath -ldflags "$LDFLAGS" -o dist/gitcortex-linux-amd64 ./cmd/gitcortex/
GOOS=linux GOARCH=arm64 go build -trimpath -ldflags "$LDFLAGS" -o dist/gitcortex-linux-arm64 ./cmd/gitcortex/
GOOS=darwin GOARCH=amd64 go build -trimpath -ldflags "$LDFLAGS" -o dist/gitcortex-darwin-amd64 ./cmd/gitcortex/
GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags "$LDFLAGS" -o dist/gitcortex-darwin-arm64 ./cmd/gitcortex/
GOOS=windows GOARCH=amd64 go build -trimpath -ldflags "$LDFLAGS" -o dist/gitcortex-windows-amd64.exe ./cmd/gitcortex/
# Publish checksums so downloads can be verified:
# sha256sum -c SHA256SUMS
- name: Checksums
run: cd dist && sha256sum gitcortex-* > SHA256SUMS
- name: Create release
uses: softprops/action-gh-release@v3
with:
files: dist/*
generate_release_notes: true