Skip to content

Commit

Permalink
Implement a release process
Browse files Browse the repository at this point in the history
  • Loading branch information
knl committed Feb 12, 2020
1 parent 247f7ed commit 089ed81
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: goreleaser

on:
push:
tags:
- 'v[0-9]*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13.x
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
37 changes: 37 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
project_name: pulley

before:
hooks:
- go mod download
- go mod tidy -v
- make lint
builds:
-
env:
- GO111MODULE=on
- CGO_ENABLED=0
ldflags:
- -s -w
- -X github.com/knl/pulley/internal/version.Version={{ .Version }}
- -X github.com/knl/pulley/internal/version.Revision={{ .FullCommit }}
- -X github.com/knl/pulley/internal/version.BuildUser={{ .Env.USER }}
- -X github.com/knl/pulley/internal/version.BuildDate={{ .Date }}
goos:
- darwin
- linux
- freebsd
- openbsd
goarch:
- amd64
- arm
- arm64
# List of combinations of GOOS + GOARCH + GOARM to ignore.
# Default is empty.
ignore:
- goos: darwin
goarch: arm
- goos: darwin
goarch: arm64
changelog:
# set it to true if you wish to skip the changelog generation
skip: true
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ clean:
rm -rf build dist
rm -f $(BIN)

.PHONY: test fmt lint tidy clean build
test-release:
goreleaser release --rm-dist --skip-publish --snapshot

.PHONY: test fmt lint tidy clean build test-release
15 changes: 15 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ A service to expose Prometheus metrics of your CI's validation of Pull Requests
(PRs), using GitHub webhooks.

image:https://github.com/knl/pulley/workflows/CI/badge.svg[CI]
image:https://github.com/knl/pulley/workflows/goreleaser/badge.svg[release]
image:https://goreportcard.com/badge/github.com/knl/pulley[link=https://goreportcard.com/report/github.com/knl/pulley, alt=Go Report Card]
image:https://codebeat.co/badges/56655dd4-44a7-45fd-9d33-0654b5a90452[link=https://codebeat.co/projects/github-com-knl-pulley-master]

Expand Down Expand Up @@ -149,3 +150,17 @@ Prior to committing the code, you could run
make

to properly format and lint the code

=== Managing releases

Releases are managed with https://goreleaser.com/[goreleaser].

To create a new release, push a tag (for example, a version 0.1.0):

git tag -a v0.1.0 -m "First release"
git push origin v0.1.0

To build a test release, without publishing, run:

make test-release

0 comments on commit 089ed81

Please sign in to comment.