Skip to content

Commit cfd2992

Browse files
authored
Merge pull request #11 from bpineau/automated-release
Publish releases from Github Actions
2 parents f21e6db + 81e9a7b commit cfd2992

File tree

3 files changed

+37
-16
lines changed

3 files changed

+37
-16
lines changed

.github/workflows/ci.yml

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: CI
22
on: [push, pull_request]
3-
jobs:
43

4+
jobs:
55
build:
66
name: Build
77
runs-on: ubuntu-18.04
@@ -16,14 +16,6 @@ jobs:
1616
- name: Check out code into the Go module directory
1717
uses: actions/checkout@v1
1818

19-
- name: Cache downloaded modules
20-
uses: actions/cache@v1
21-
with:
22-
path: ~/go/pkg/mod
23-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
24-
restore-keys: |
25-
${{ runner.os }}-go-
26-
2719
- name: Build
2820
run: go build
2921

@@ -38,8 +30,8 @@ jobs:
3830
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3931

4032
- name: Send coverage
41-
env:
42-
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4333
run: |
4434
GO111MODULE=off go get github.com/mattn/goveralls
4535
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github
36+
env:
37+
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: release
2+
3+
on:
4+
push:
5+
# Sequence of patterns matched against refs/tags
6+
tags:
7+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
8+
9+
jobs:
10+
goreleaser:
11+
runs-on: ubuntu-18.04
12+
steps:
13+
14+
- name: Set up Go 1.13
15+
uses: actions/setup-go@v1
16+
with:
17+
go-version: 1.13
18+
id: go
19+
20+
- name: Check out code into the Go module directory
21+
uses: actions/checkout@v1
22+
23+
- name: Log into Docker registry
24+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
25+
26+
- name: Run GoReleaser
27+
uses: goreleaser/goreleaser-action@v1
28+
with:
29+
version: v0.123.3
30+
args: release --rm-dist --skip-sign
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@ before:
1515
- go mod download
1616

1717
release:
18-
# don't autopublish
18+
# publish as a github release draft - let a human validate
1919
draft: true
2020

21-
#signs:
22-
# - artifacts: checksum
23-
2421
changelog:
2522
filters:
2623
exclude:
@@ -33,4 +30,4 @@ dockers:
3330
goos: linux
3431
goarch: amd64
3532
dockerfile: Dockerfile.goreleaser
36-
skip_push: true
33+
#skip_push: true

0 commit comments

Comments
 (0)