Skip to content

Commit

Permalink
ci: switches release process to gh actions and goreleaser (#87)
Browse files Browse the repository at this point in the history
Also preserves coveralls and appveyor. Closes #58
  • Loading branch information
mavogel committed Jan 16, 2021
1 parent d631543 commit c41bf3a
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 41 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,26 @@
name: goreleaser

on:
push:
tags:
- '*'

jobs:
goreleaser:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,37 @@
name: tests

on:
pull_request:
types: ['opened', 'synchronize']
paths-ignore:
- 'README.md'
push:
branches:
- master
paths-ignore:
- 'README.md'
jobs:
unit:
runs-on: ubuntu-20.04
strategy:
fail-fast: true
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
- name: Run tests
run: |
make test
- name: Install goveralls
env:
GO111MODULE: off
run: go get github.com/mattn/goveralls
- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=cover.out -service=github
48 changes: 48 additions & 0 deletions .goreleaser.yml
@@ -0,0 +1,48 @@
# This is an example .goreleaser.yml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
project_name: git-chglog

before:
hooks:
# You may remove this if you don't use go modules.
- go mod download

builds:
- dir: cmd/git-chglog
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm
- arm64
goarm:
- 6

archives:
- format_overrides:
- goos: windows
format: zip

checksum:
name_template: 'checksums.txt'

changelog:
sort: asc

snapshot:
name_template: "{{ .Tag }}-next"

brews:
- tap:
owner: git-chglog
name: homebrew-git-chglog
homepage: "https://godoc.org/github.com/git-chglog/git-chglog"
description: "CHANGELOG generator implemented in Go (Golang)."
test: |
system "#{bin}/git-chglog --help"
install: |
bin.install "git-chglog"
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

8 changes: 1 addition & 7 deletions Makefile
Expand Up @@ -11,13 +11,7 @@ build:

.PHONY: test
test:
go test -v `go list ./...`

.PHONY: coverage
coverage:
goverage -coverprofile=cover.out `go list ./...`
go tool cover -func=cover.out
@rm -rf cover.out
go test -covermode atomic -coverprofile cover.out -v ./...

.PHONY: install
install:
Expand Down
10 changes: 0 additions & 10 deletions scripts/release.sh

This file was deleted.

0 comments on commit c41bf3a

Please sign in to comment.