-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (47 loc) · 1.53 KB
/
go-release.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
name: release
on:
push:
branches:
- main
jobs:
release-please:
runs-on: ubuntu-latest
name: release please
outputs:
releases_created: ${{ steps.release-please.outputs.releases_created }}
tag_name: ${{ steps.release-please.outputs[format('{0}--tag_name', steps.get-path.outputs.path)] }}
path: ${{ steps.get-path.outputs.path }}
steps:
- name: Release Please
uses: googleapis/release-please-action@v4
id: release-please
with:
config-file: .release-please/release-please-config.json
manifest-file: .release-please/.release-please-manifest.json
- name: Get Path
id: get-path
if: ${{ steps.release-please.outputs.releases_created == 'true' }}
run: |
echo "path=${{ fromJson(steps.release-please.outputs.paths_released)[0] }}" >> $GITHUB_OUTPUT
goreleaser:
runs-on: ubuntu-latest
name: release
needs: release-please
if: ${{ needs.release-please.outputs.releases_created == 'true' }}
steps:
- name: Checkout
run: |
git version
git clone "${{ github.event.repository.html_url }}" /home/runner/work/kook-go/kook-go
git checkout "${{ github.ref }}"
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.21'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}