diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 574980a..bcfda7a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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/go-release-action@v1.18 + - 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 }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d9cf4a1..3946e42 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -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: | diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..a6a1801 --- /dev/null +++ b/.goreleaser.yml @@ -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"