-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (68 loc) · 1.99 KB
/
release.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
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
name: Release
on:
push:
# pull_request:
# branches:
# - '**'
workflow_dispatch:
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
jobs:
# test:
# runs-on: ubuntu-22.04
# strategy:
# matrix:
# go: ['1.17', '1.18', '1.19']
# name: Go ${{ matrix.go }} test
# steps:
# - uses: actions/checkout@v3
# - name: Setup go
# uses: actions/setup-go@v3
# with:
# go-version: ${{ matrix.go }}
# - run: go test -race -v -coverprofile=profile.cov ./pkg/...
# - uses: codecov/[email protected]
# with:
# file: ./profile.cov
# name: codecov-go
release:
name: semantic-release
runs-on: ubuntu-22.04
# needs: [test]
# if: ${{ github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:
new-release-published: ${{ steps.semantic.outputs.new_release_published }}
new-release-version: ${{ steps.semantic.outputs.new_release_version }}
steps:
- name: Source checkout
uses: actions/checkout@v3
- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@v3
with:
semantic_version: 19.0.5
goreleaser:
name: binary-release
runs-on: ubuntu-latest
needs:
- release
if: needs.release.outputs.new-release-published == 'true'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v4
with:
go-version: stable
# More assembly might be required: Docker logins, GPG, etc. It all depends
# on your needs.
- uses: goreleaser/goreleaser-action@v4
with:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}