Skip to content

Commit

Permalink
Add goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
prskr committed Apr 8, 2020
1 parent d7f7427 commit 6051ea1
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 23 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/go-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Go

on: [push, pull_request]

jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14.x
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Unshallow
run: git fetch --prune --unshallow

- name: Build & test
run: make

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
key: ${{ secrets.YOUR_PRIVATE_KEY }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 0 additions & 22 deletions .github/workflows/go.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ main
# directories #
###############

.idea/
.idea/
dist/
35 changes: 35 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- make plugins
builds:
- id: "default"
ldflags:
- -w -s
goos:
- linux
goarch:
- amd64
archives:
- id: default
builds:
- default
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
replacements:
amd64: x86_64
wrap_in_directory: true
files:
- config.yaml
- plugins/*.so
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

0 comments on commit 6051ea1

Please sign in to comment.