-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (39 loc) · 1.27 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
name: Publish
on:
push:
paths:
- ".speakeasy/gen.lock"
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
goreleaser:
runs-on: ubuntu-latest
# Releases need permissions to read and write the repository contents.
# GitHub considers creating releases and uploading assets as writing contents.
permissions:
contents: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
# Allow goreleaser to access older tag information.
fetch-depth: 0
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5
with:
go-version-file: "go.mod"
- name: Read current version + create tag
run: |
TAG=$(yq '.management.releaseVersion' .speakeasy/gen.lock)
git config --global user.email "[email protected]"
git config --global user.name "kong-apiops[bot]"
git tag -a v$TAG -m "Release v$TAG"
git push origin v$TAG
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 # v6.2.1
with:
args: release --clean
version: ~> v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}