Skip to content

Commit

Permalink
Merge pull request #44 from dirien/feature/goreleaser
Browse files Browse the repository at this point in the history
feat: add goreleaser for gt cli
  • Loading branch information
Engin Diri authored Oct 20, 2021
2 parents 943c2b1 + 2f6fbbd commit aa029f1
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
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

0 comments on commit aa029f1

Please sign in to comment.