Skip to content

Commit 5f62352

Browse files
akramHeavyWombatSaschaSchwarze0
authored andcommitted
Release workflow for shp CLI
- Use gorelease to create binaries for windows, linux, and macOS on amd64 and arm64. - Run workflow whenever a semantic version tag is created. - Binary is named `shp` and optimized for space efficiency. Co-authored-by: Akram Ben Aissi <[email protected]> Co-authored-by: Matthias Diester <[email protected]> Co-authored-by: Sascha Schwarze <[email protected]>
1 parent 4831482 commit 5f62352

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

.github/workflows/release.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Release
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
jobs:
8+
release:
9+
name: Release
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
- name: Set up Go
17+
uses: actions/setup-go@v2
18+
with:
19+
go-version: 1.17.x
20+
- name: Run GoReleaser
21+
uses: goreleaser/goreleaser-action@v2
22+
with:
23+
version: latest
24+
args: release --rm-dist
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ _output/
22
/shp
33
/shp-*
44
/bin/*
5+
dist/

.goreleaser.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
before:
2+
hooks:
3+
- go generate ./...
4+
builds:
5+
- env:
6+
- CGO_ENABLED=0
7+
goos:
8+
- linux
9+
- darwin
10+
- windows
11+
goarch:
12+
- amd64
13+
- arm64
14+
flags:
15+
- -trimpath
16+
ldflags:
17+
- -s -w -extldflags "-static"
18+
main: ./cmd/shp/main.go
19+
binary: shp
20+
archives:
21+
- replacements:
22+
darwin: macOS
23+
amd64: x86_64
24+
checksum:
25+
name_template: 'checksums.txt'
26+
snapshot:
27+
name_template: "{{ incpatch .Version }}-next"
28+
changelog:
29+
sort: asc
30+
filters:
31+
exclude:
32+
- '^docs:'
33+
- '^test:'

0 commit comments

Comments
 (0)