Skip to content

Commit

Permalink
Publish binaries with goreleaser (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluekeyes committed Jan 9, 2024
1 parent 8dac3b6 commit 85d00c0
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Go

on:
pull_request:
push:
Expand All @@ -12,12 +13,12 @@ jobs:
name: Verify
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.20
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.20"

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

- name: Lint
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release

on:
release:
types: [published]

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.20"

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: v1.23.0
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/patch2pr
.idea/

/patch2pr
dist/
29 changes: 29 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 1

builds:
- main: ./cmd/patch2pr
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
ignore:
- goos: windows
goarch: arm64

archives:
- format: tar.gz
name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}-{{ .Arch }}"
format_overrides:
- goos: windows
format: zip
files:
# https://github.com/goreleaser/goreleaser/issues/602
- none*

release:
mode: keep-existing
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ that uses this library to apply it and create a pull request.

## Usage: CLI

Install the CLI using `go install`:
Pre-built binaries for common platforms are available on the [releases][] page.

You can also install from source using `go install`:

go install github.com/bluekeyes/patch2pr/cmd/patch2pr@latest

Expand All @@ -39,6 +41,8 @@ For example:

See the CLI help (`-h` or `-help`) or below for full details.

[releases]: https://github.com/bluekeyes/patch2pr/releases

### Full Usage

```
Expand Down

0 comments on commit 85d00c0

Please sign in to comment.