Skip to content

Commit 13a1dfd

Browse files
committed
Provide binaries with GoReleaser
1 parent 49e8064 commit 13a1dfd

File tree

4 files changed

+55
-9
lines changed

4 files changed

+55
-9
lines changed

.github/workflows/main.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,32 @@
11
name: Main
22
on: push
3+
permissions:
4+
contents: write
35
jobs:
46
test_publish:
57
name: Test and build
68
runs-on: ubuntu-latest
79
steps:
8-
- uses: actions/checkout@v2
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
with:
13+
fetch-depth: 0
914
- name: Install dependencies
1015
run: make setup
16+
- name: Export GOBIN
17+
uses: actions/setup-go@v2
18+
with:
19+
go-version: 1.16
1120
- name: Run tests
12-
run: |
13-
export PATH="$PATH:$(go env GOPATH)/bin" # Currently the path needs to be set manually.
14-
make test
21+
run: make test
1522
- name: Build
1623
run: make build
24+
- name: Run GoReleaser
25+
uses: goreleaser/goreleaser-action@v2
26+
if: startsWith(github.ref, 'refs/tags/') # Only release for tagged commits.
27+
with:
28+
distribution: goreleaser
29+
version: latest
30+
args: release --rm-dist
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
dist/
12
out/
23

34
### Go

.goreleaser.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
builds:
2+
- id: pbcli
3+
main: ./cmd/pbcli
4+
goos:
5+
- linux
6+
- windows
7+
- freebsd
8+
- openbsd
9+
- darwin
10+
goarch:
11+
- amd64
12+
- 386
13+
- arm
14+
- arm64
15+
ignore:
16+
- goos: freebsd
17+
goarch: arm64
18+
19+
checksum:
20+
algorithm: sha256
21+
22+
archives:
23+
- id: pbcli
24+
builds:
25+
- pbcli
26+
format: tar.gz
27+
replacements:
28+
darwin: macOS
29+
format_overrides:
30+
- goos: windows
31+
format: zip

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@ Further, it can be used by administrators to add and remove users.
1717

1818
## Installation
1919

20-
The following command will download, build, and install the tool.
21-
20+
It it easiest to download the binary from the [latest release](https://github.com/pushbits/cli/releases).
21+
Alternatively, build it yourself:
2222
```bash
23-
go get -u github.com/pushbits/cli/cmd/pbcli
23+
go get -u github.com/pushbits/cli/cmd/...
2424
```
2525

26-
Note that this requires [a working Go 1.12+ installation](https://golang.org/doc/install).
27-
2826
## Usage
2927

3028
If you are a normal user of PushBits, you will most likely just want to manage your applications.

0 commit comments

Comments
 (0)