Skip to content

Commit 85d00c0

Browse files
authored
Publish binaries with goreleaser (#78)
1 parent 8dac3b6 commit 85d00c0

File tree

5 files changed

+69
-4
lines changed

5 files changed

+69
-4
lines changed

.github/workflows/go.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Go
2+
23
on:
34
pull_request:
45
push:
@@ -12,12 +13,12 @@ jobs:
1213
name: Verify
1314
runs-on: ubuntu-latest
1415
steps:
15-
- name: Set up Go 1.20
16+
- name: Set up Go
1617
uses: actions/setup-go@v5
1718
with:
1819
go-version: "1.20"
1920

20-
- name: Check out code into the Go module directory
21+
- name: Checkout
2122
uses: actions/checkout@v4
2223

2324
- name: Lint

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
goreleaser:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Set up Go
15+
uses: actions/setup-go@v5
16+
with:
17+
go-version: "1.20"
18+
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Run GoReleaser
25+
uses: goreleaser/goreleaser-action@v5
26+
with:
27+
version: v1.23.0
28+
args: release --clean
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
/patch2pr
21
.idea/
32

3+
/patch2pr
4+
dist/

.goreleaser.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: 1
2+
3+
builds:
4+
- main: ./cmd/patch2pr
5+
env:
6+
- CGO_ENABLED=0
7+
goos:
8+
- linux
9+
- windows
10+
- darwin
11+
goarch:
12+
- amd64
13+
- arm64
14+
ignore:
15+
- goos: windows
16+
goarch: arm64
17+
18+
archives:
19+
- format: tar.gz
20+
name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}-{{ .Arch }}"
21+
format_overrides:
22+
- goos: windows
23+
format: zip
24+
files:
25+
# https://github.com/goreleaser/goreleaser/issues/602
26+
- none*
27+
28+
release:
29+
mode: keep-existing

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ that uses this library to apply it and create a pull request.
1616

1717
## Usage: CLI
1818

19-
Install the CLI using `go install`:
19+
Pre-built binaries for common platforms are available on the [releases][] page.
20+
21+
You can also install from source using `go install`:
2022

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

@@ -39,6 +41,8 @@ For example:
3941

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

44+
[releases]: https://github.com/bluekeyes/patch2pr/releases
45+
4246
### Full Usage
4347

4448
```

0 commit comments

Comments
 (0)