Skip to content

Commit bb1aa98

Browse files
committed
Support to release via goreleaser
1 parent 6bf1a10 commit bb1aa98

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

.github/workflows/build.yaml

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

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@
1414
# Dependency directories (remove the comment below to include it)
1515
# vendor/
1616
bin/
17+
.idea/
18+
release

.goreleaser.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Official documentation at http://goreleaser.com
2+
project_name: tcli
3+
builds:
4+
- env:
5+
- CGO_ENABLED=0
6+
binary: tcli
7+
main: ./cli/main.go
8+
goos:
9+
- windows
10+
- linux
11+
- darwin
12+
ignore:
13+
- goarch: arm
14+
- goarch: arm64
15+
- goarch: 386
16+
ldflags:
17+
- -w
18+
- -s
19+
dist: release
20+
archives:
21+
- name_template: "{{ .Binary }}-{{ .Os }}-{{ .Arch }}"
22+
format_overrides:
23+
- goos: windows
24+
format: zip
25+
files:
26+
- README.md
27+
checksum:
28+
name_template: 'checksums.txt'
29+
snapshot:
30+
name_template: "{{ .Tag }}-next-{{.ShortCommit}}"

0 commit comments

Comments
 (0)