-
Notifications
You must be signed in to change notification settings - Fork 25
77 lines (72 loc) · 2.14 KB
/
go.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Go
on:
pull_request_target:
branches: [go-rewrite, canary]
push:
branches: [go-rewrite, canary, feature/*]
paths-ignore:
- README.md
- .github/workflows/go.yml
- .gitignore
- .goreleaser.yml
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && !contains(github.event.head_commit.message, 'Merge pull request') && !contains(github.event.head_commit.message, 'ci:')) }}
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Install dependencies
continue-on-error: true
run: |
go get -u github.com/golang/dep/cmd/dep
dep ensure
- name: Run tests
continue-on-error: true
run: |
go test -v ./__tests__
- name: Snapshot
uses: goreleaser/goreleaser-action@v2
with:
args: --snapshot --rm-dist
version: latest
distribution: goreleaser
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
UNSPLASH_CLIENT_ID: ${{ secrets.CLIENT_ID }}
UNSPLASH_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
DEBUG: true
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: Snapshot
path: dist
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Test
run: go test -v ./__tests__
- name: Release
uses: goreleaser/goreleaser-action@v2
with:
version: latest
distribution: goreleaser
args: release --rm-dist
env:
DEBUG: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UNSPLASH_CLIENT_ID: ${{ secrets.CLIENT_ID }}
UNSPLASH_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}