Skip to content

Commit

Permalink
Merge pull request #11 from NagayamaRyoga/main
Browse files Browse the repository at this point in the history
release tap automatically using GoReleaser
  • Loading branch information
kitagry authored Mar 19, 2022
2 parents 4f6b2fd + 524c75e commit cec6504
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 19 deletions.
38 changes: 20 additions & 18 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
name: Release

on:
release:
types: [created]
push:
tags: ["*"]

jobs:
releases-matrix:
release:
name: Release Go Binary
runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/386, linux/amd64, windows/386, windows/amd64, darwin/amd64
goos: [linux, windows, darwin]
goarch: ["386", amd64]
exclude:
- goarch: "386"
goos: darwin
steps:
- uses: actions/checkout@v2
- uses: wangyoucao577/[email protected]
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
id: go

- uses: goreleaser/goreleaser-action@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
project_path: "./"
binary_name: "kj"
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Get dependencies
run: |
Expand Down
29 changes: 29 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
builds:
- goos:
- windows
- darwin
- linux
goarch:
- amd64
- arm64
- 386

archives:
- replacements:
darwin: darwin
linux: linux
windows: windows
386: i386
amd64: amd64
format_overrides:
- goos: windows
format: zip

brews:
- description: Edit and create Kubernetes job from cronjob template using your EDITOR
tap:
owner: kitagry
name: homebrew-tap
folder: Formula
homepage: https://github.com/kitagry/kj
install: bin.install "kj"

0 comments on commit cec6504

Please sign in to comment.