Skip to content

Commit a81f751

Browse files
committed
Use goreleaser to publish releases
- Binaries are published instead of archives - 32bit macOS and Linux versions are built - sha256 checksums are published - Changelog is published
1 parent 715c8f3 commit a81f751

File tree

3 files changed

+26
-12
lines changed

3 files changed

+26
-12
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,21 @@ on:
66
- 'v*'
77

88
jobs:
9-
build:
9+
release:
1010
runs-on: ubuntu-latest
11-
name: Build
1211
steps:
1312
- name: Checkout code
1413
uses: actions/checkout@v2
14+
- name: Unshallow
15+
run: git fetch --prune --unshallow
1516
- name: Setup Go
1617
uses: actions/setup-go@v1
1718
with:
1819
go-version: '1.13.8'
19-
- name: Install gox
20-
run: go get github.com/mitchellh/gox
21-
- name: Build binaries in parallel
22-
run: $HOME/go/bin/gox -osarch="linux/amd64 darwin/amd64 windows/386 windows/amd64" -output "build/vault-plugin-database-aerospike_${GITHUB_REF##*/}_{{.OS}}_{{.Arch}}/vault-plugin-database-aerospike" ./plugin
23-
- name: Package binaries
24-
run: cd build; for dir in *; do zip -r $dir.zip $dir; done
25-
- name: Release
26-
uses: softprops/action-gh-release@v1
20+
- name: Run goreleaser
21+
uses: goreleaser/goreleaser-action@v1
2722
with:
28-
files: build/*.zip
23+
version: v0.129.0
24+
args: release --rm-dist
2925
env:
3026
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
build/
1+
dist/

.goreleaser.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
builds:
2+
- main: ./plugin
3+
env:
4+
- CGO_ENABLED=0
5+
goos:
6+
- darwin
7+
- linux
8+
- windows
9+
archives:
10+
- format: binary
11+
checksum:
12+
name_template: checksums.txt
13+
algorithm: sha256
14+
changelog:
15+
sort: asc
16+
filters:
17+
exclude:
18+
- '^\[docs\]'

0 commit comments

Comments
 (0)