Skip to content

Commit

Permalink
Add goreleaser.
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Krivak committed May 3, 2020
1 parent 8218a40 commit 66f3818
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 6 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
on:
push:
tags: ['*']

name: Release

jobs:
goreleaser:
runs-on: ubuntu-latest

steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.14.x
- name: Checkout code
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ name: Test

jobs:
test:
name: Test

strategy:
matrix:
go-version: [1.11.x, 1.12.x, 1.13.x, 1.14.x]
platform: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/dist/
/godot
12 changes: 12 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
builds:
- dir: ./cmd/godot
checksum:
name_template: checksums.txt
snapshot:
name_template: "{{ .Tag }}"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
VERSION := $(shell git describe --tags)

.PHONY: test
test:
go test ./...

.PHONY: build
build:
go build -ldflags="-X 'main.version=$(VERSION)'" -o godot ./cmd/godot
go build -o godot ./cmd/godot

.PHONY: release
release:
goreleaser release --rm-dist
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,21 @@ end of the last sentence if needed.
## Install and run

Build from source
```sh
go get -u github.com/tetafro/godot/cmd/godot
```

Or download binary from [releases page](https://github.com/tetafro/godot/releases)
like this
```sh
version=0.3.5
platform=linux_amd64
curl -L https://github.com/tetafro/godot/releases/download/v${version}/godot_${version}_${platform}.tar.gz | tar xzf - -C $GOPATH/bin
```

Run
```sh
godot ./myproject
```

Expand Down

0 comments on commit 66f3818

Please sign in to comment.