Skip to content

Commit 24d7a98

Browse files
Replace with Goreleaser.
1 parent 200963d commit 24d7a98

File tree

5 files changed

+56
-37
lines changed

5 files changed

+56
-37
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
steps:
1111
- name: Clone repository
1212
uses: actions/[email protected]
13-
- name: Setup Go
14-
uses: actions/setup-go@v1
13+
- name: Set up Go
14+
uses: actions/setup-go@v2
1515
with:
1616
go-version: 1.16
1717
- name: Test application

.github/workflows/go-release.yml

+21-34
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,26 @@
1-
on: release
2-
name: Release Go Application
1+
name: Release tgen
2+
on:
3+
push:
4+
tags:
5+
- '*'
36

47
jobs:
5-
release-linux:
8+
goreleaser:
69
runs-on: ubuntu-latest
710
steps:
8-
- name: Clone repository
9-
uses: actions/[email protected]
10-
- name: Compile and release for Linux amd64
11-
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
- name: Set up Go
16+
uses: actions/setup-go@v2
17+
with:
18+
go-version: 1.16
19+
- name: Run GoReleaser
20+
uses: goreleaser/goreleaser-action@v2
21+
with:
22+
distribution: goreleaser
23+
version: latest
24+
args: release --rm-dist
1225
env:
13-
GITHUB_TOKEN: ${{ github.token }}
14-
GOARCH: amd64
15-
GOOS: linux
16-
17-
release-darwin:
18-
runs-on: ubuntu-latest
19-
steps:
20-
- name: Clone repository
21-
uses: actions/[email protected]
22-
- name: Compile and release for Darwin amd64
23-
24-
env:
25-
GITHUB_TOKEN: ${{ github.token }}
26-
GOARCH: amd64
27-
GOOS: darwin
28-
29-
release-windows:
30-
runs-on: ubuntu-latest
31-
steps:
32-
- name: Clone repository
33-
uses: actions/[email protected]
34-
- name: Compile and release for Windows amd64
35-
36-
env:
37-
GITHUB_TOKEN: ${{ github.token }}
38-
GOARCH: amd64
39-
GOOS: windows
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
tgen
22
tests/
3+
dist/

.goreleaser.yml

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

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module github.com/patrickdappollonio/tgen
22

33
require github.com/spf13/cobra v1.2.1
44

5-
go 1.14
5+
go 1.16

0 commit comments

Comments
 (0)