Skip to content

Commit 82a9590

Browse files
akramadambkaplan
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.
1 parent 4831482 commit 82a9590

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-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

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
main: ./cmd/shp/main.go
15+
archives:
16+
- replacements:
17+
darwin: macOS
18+
amd64: x86_64
19+
checksum:
20+
name_template: 'checksums.txt'
21+
snapshot:
22+
name_template: "{{ incpatch .Version }}-next"
23+
changelog:
24+
sort: asc
25+
filters:
26+
exclude:
27+
- '^docs:'
28+
- '^test:'

0 commit comments

Comments
 (0)