-
-
Notifications
You must be signed in to change notification settings - Fork 78
36 lines (35 loc) · 958 Bytes
/
main.yaml
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
on:
push:
branches:
- "master"
tags:
- "v*.*.*"
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '1.21'
- name: Declare some variables
id: vars
run: |
echo "::set-output name=coverage_txt::${RUNNER_TEMP}/coverage.txt"
- name: Test Coverage (pkg)
run: go test ./... -coverprofile=${{ steps.vars.outputs.coverage_txt }}
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
files: ${{ steps.vars.outputs.coverage_txt }}
- name: Run GoReleaser
if: contains(github.ref, 'tags/v')
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}