Skip to content

Commit 8f88c1a

Browse files
committed
[add] goreleaser
1 parent a2dcfa8 commit 8f88c1a

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed

.github/workflows/goreleaser.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
tags: #vX.X.Xというタグのときにリリースする
6+
- "v[0-9]+.[0-9]+.[0-9]+"
7+
jobs:
8+
goreleaser:
9+
runs-on: ubuntu-latest
10+
steps:
11+
-
12+
name: Checkout
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
-
17+
name: Set up Go
18+
uses: actions/setup-go@v2
19+
with:
20+
go-version: 1.17
21+
-
22+
name: Run GoReleaser
23+
uses: goreleaser/goreleaser-action@v2
24+
with:
25+
version: latest
26+
args: release --rm-dist
27+
env:
28+
# need to access other repository for brew-tap
29+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}

.goreleaser.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
before:
2+
hooks:
3+
- go mod tidy # tidyしておけば間違いない
4+
builds:
5+
- main: ./
6+
env:
7+
- CGO_ENABLED=0
8+
archives:
9+
- replacements:
10+
darwin: Darwin
11+
linux: Linux
12+
windows: Windows
13+
386: i386
14+
amd64: x86_64
15+
checksum:
16+
name_template: 'checksums.txt'
17+
snapshot:
18+
name_template: "{{ .Tag }}-next"
19+
changelog:
20+
sort: asc
21+
filters:
22+
exclude:
23+
- '^docs:'
24+
- '^example:'
25+
brews:
26+
-
27+
# Name template of the recipe
28+
# Default to project name
29+
name: manaita
30+
31+
# Github repository to push the tap to.
32+
github:
33+
owner: igtm
34+
name: homebrew-tap
35+
36+
# Template for the url which is determined by the given Token (github or gitlab)
37+
# Default for github is "https://github.com/<repo_owner>/<repo_name>/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
38+
# Default for gitlab is "https://gitlab.com/<repo_owner>/<repo_name>/uploads/{{ .ArtifactUploadHash }}/{{ .ArtifactName }}"
39+
url_template: "https://github.com/igtm/manaita/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
40+
41+
# Git author used to commit to the repository.
42+
# Defaults are shown.
43+
commit_author:
44+
name: goreleaserbot
45+
46+
47+
# Your app's homepage.
48+
# Default is empty.
49+
homepage: "https://github.com/igtm/manaita"
50+
51+
# Your app's description.
52+
# Default is empty.
53+
description: "Simple Markdown-Driven Code Generator written by Go"
54+
55+
# Custom install script for brew.
56+
# Default is 'bin.install "program"'.
57+
install: |
58+
bin.install "manaita"

0 commit comments

Comments
 (0)