Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add goreleaser for gt cli #44

Merged
merged 1 commit into from
Oct 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release

on:
push:
tags:
- '*'

jobs:
release:
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:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34 changes: 34 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
project_name: gt

snapshot:
name_template: '{{ .Tag }}-SNAPSHOT'

before:
hooks:
- go mod tidy

dist: bin

builds:
- id: gt
env:
- CGO_ENABLED=0
main: ./cmd/gt
ldflags:
- -s
- -w
- -extldflags '-static'
goos:
- linux
- windows
- darwin
ignore:
- goos: windows
goarch: arm64
goarch:
- amd64
- arm64

archives:
- format: binary
name_template: '{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}'
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@

### Install

If you have Go 1.16+, you can directly install by running:

```bash
go install github.com/schwarzit/go-template/cmd/gt@latest
```

#### Install from the released binaries
Download the desired version for your operating system and processor architecture from the [go-template releases page](https://github.com/SchwarzIT/go-template/releases).
Make the file executable and place it in a directory available in your $PATH.

### Initialize your repo from the template

[![asciicast](https://asciinema.org/a/441624.svg)](https://asciinema.org/a/441624?autoplay=1&speed=2&size=medium)
Expand Down