Provide binaries with GoReleaser

This commit is contained in:
eikendev
2021-06-06 17:28:24 +02:00
parent 49e8064905
commit 13a1dfd6f8
4 changed files with 55 additions and 9 deletions

View File

@@ -1,16 +1,32 @@
name: Main
on: push
permissions:
contents: write
jobs:
test_publish:
name: Test and build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install dependencies
run: make setup
- name: Export GOBIN
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Run tests
run: |
export PATH="$PATH:$(go env GOPATH)/bin" # Currently the path needs to be set manually.
make test
run: make test
- name: Build
run: make build
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref, 'refs/tags/') # Only release for tagged commits.
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
dist/
out/
### Go

31
.goreleaser.yml Normal file
View File

@@ -0,0 +1,31 @@
builds:
- id: pbcli
main: ./cmd/pbcli
goos:
- linux
- windows
- freebsd
- openbsd
- darwin
goarch:
- amd64
- 386
- arm
- arm64
ignore:
- goos: freebsd
goarch: arm64
checksum:
algorithm: sha256
archives:
- id: pbcli
builds:
- pbcli
format: tar.gz
replacements:
darwin: macOS
format_overrides:
- goos: windows
format: zip

View File

@@ -17,14 +17,12 @@ Further, it can be used by administrators to add and remove users.
## Installation
The following command will download, build, and install the tool.
It it easiest to download the binary from the [latest release](https://github.com/pushbits/cli/releases).
Alternatively, build it yourself:
```bash
go get -u github.com/pushbits/cli/cmd/pbcli
go get -u github.com/pushbits/cli/cmd/...
```
Note that this requires [a working Go 1.12+ installation](https://golang.org/doc/install).
## Usage
If you are a normal user of PushBits, you will most likely just want to manage your applications.