Skip to content

Commit 2a8dd7b

Browse files
committed
add goreleaser
1 parent ea19c02 commit 2a8dd7b

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: release
2+
on:
3+
push:
4+
tags:
5+
- "v[0-9]+.[0-9]+.[0-9]+"
6+
jobs:
7+
goreleaser:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
- name: Unshallow
13+
run: git fetch --prune --unshallow
14+
- name: Setup Go
15+
uses: actions/setup-go@v1
16+
with:
17+
go-version: 1.13
18+
- name: Run GoReleaser
19+
uses: goreleaser/goreleaser-action@v1
20+
with:
21+
version: latest
22+
args: release --rm-dist
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
project_name: pythonbrew
2+
env:
3+
- GO111MODULE=on
4+
before:
5+
hooks:
6+
- go mod tidy
7+
builds:
8+
-
9+
main: ./cmd/pythonbrew/pythonbrew.go
10+
binary: pythonbrew
11+
flags: -trimpath
12+
ldflags:
13+
- -s -w
14+
- -X github.com/utahta/pythonbrew/subcmd.Version={{.Version}}
15+
env:
16+
- CGO_ENABLED=0
17+
goos:
18+
- darwin
19+
- linux
20+
- freebsd
21+
- windows
22+
archives:
23+
-
24+
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
25+
format_overrides:
26+
- goos: windows
27+
format: zip
28+
release:
29+
prerelease: auto

0 commit comments

Comments
 (0)