forked from timescale/promscale
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (51 loc) · 1.54 KB
/
go-releaser.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: goreleaser
on:
push:
branches: [master, main, force_test, release-*, staging, trying]
tags: ['*']
pull_request:
branches: ['**']
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Import environment variables
run: cat ".github/env" >> $GITHUB_ENV
-
name: Set up Go
uses: actions/setup-go@v2.1.4
with:
go-version: ${{ env.golang-version }}
-
name: Login to Docker Hub
uses: docker/login-action@v1
#login only on tags. Note that login can't work on PRs from forked repos because of missing secrets
#this gets around that by only logging in when needed.
if: startsWith(github.ref, 'refs/tags/')
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Run GoReleaser Test
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --snapshot --skip-publish --rm-dist -f build/.goreleaser.yml
-
name: GoReleaser Release
uses: goreleaser/goreleaser-action@v2
#release only on tags
if: startsWith(github.ref, 'refs/tags/')
with:
distribution: goreleaser
version: latest
args: release --rm-dist -f build/.goreleaser.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}