Skip to content

Commit

Permalink
Merge pull request #1 from aspettl/release-binaries
Browse files Browse the repository at this point in the history
Add GoReleaser for initial release
  • Loading branch information
aspettl authored Jan 15, 2022
2 parents 66e4eb1 + 2e3eb5c commit c9e377a
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 4 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: goreleaser

on:
push:
tags:
- '*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ go.work
# Output folder for example config file
example/bin/*
!example/bin/.gitkeep

# GoReleaser
dist/
34 changes: 34 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
files:
- README.md
- LICENSE
- example/**
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,25 @@ i.e., CLI tools that can be started in a Docker or Podman container.

## How to use

### Compile and run
### Option 1: Use prebuilt binary (recommended)

There is no prebuilt binary at the moment, run `go build` to compile.
Then, `./ccliwrapper --help` shows some usage hints.
Binaries are automatically built for all releases and can be downloaded from the
release page at GitHub. Extract the artifact suitable for your platform and run
`./ccliwrapper --help` to get some usage hints.

Generate wrapper scripts for example config:

./ccliwrapper generate --config=example/ccliwrapper.yaml

The example config also functions as documentation for now.

### Use prebuilt docker image
**Note: only the x64 artifact for Linux is tested for now.**

### Option 2: Compile and run

Check out this repository and run `go build` to compile. Then see Option 1.

### Option 3: Use prebuilt docker image

There is a distroless image for `ccliwrapper` that can be easily used. Of course, this
means that you need to take care that all folders (config file, output folder) needed
Expand Down

0 comments on commit c9e377a

Please sign in to comment.