Skip to content

Commit

Permalink
add release configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
tukaelu committed Nov 5, 2023
1 parent cbec0aa commit f19cc75
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflow/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Generate Token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.TOKEN_APP_ID }}
private_key: ${{ secrets.TOKEN_APP_PRIVATE_KEY }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAP_GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dist/
*.yml
/*.yml
55 changes: 55 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
---
project_name: ikesu
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
builds:
- main: ./cmd/ikesu/
binary: ikesu
flags:
- -trimpath
ldflags:
- -s -w
- -X main.version={{ .Version }}
- -X main.revision={{ .ShortCommit }}
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64

archives:
- format: zip
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
files:
- README.md
- README-ja.md
- LICENSE
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
brews:
- repository:
owner: tukaelu
name: homebrew-tap
token: "{{ .Env.TAP_GITHUB_TOKEN }}"
- folder: Formula

# The lines beneath this are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

0 comments on commit f19cc75

Please sign in to comment.