-
Notifications
You must be signed in to change notification settings - Fork 20
60 lines (54 loc) · 1.93 KB
/
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
57
58
59
60
on:
push:
branches:
- main
name: release-please
jobs:
release-please:
runs-on: self-hosted
steps:
- uses: actions/github-script@v5
id: configure-changelog
with:
result-encoding: string
script: |
const changelogTypes = [
{type: "feat", section: "Features", hidden: false},
{type: "chore", section: "Misc", hidden: false},
{type: "fix", section: "BugFixes", hidden: false},
]
return JSON.stringify(changelogTypes)
# See https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow
# For why we need to generate a token and not use the default
- name: Generate token
id: generate_token
uses: chanzuckerberg/[email protected]
with:
app_id: ${{ secrets.CZI_RELEASE_PLEASE_APP_ID }}
private_key: ${{ secrets.CZI_RELEASE_PLEASE_PK }}
- name: release please
uses: google-github-actions/[email protected]
id: release
with:
release-type: simple
bump-minor-pre-major: true
changelog-types: ${{ steps.configure-changelog.outputs.result }}
token: ${{ steps.generate_token.outputs.token }}
- uses: actions/checkout@v2
# we need to fetch all history and tags
# so we build the proper version
with:
fetch-depth: 0
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-go@v3
with:
go-version-file: go.mod
if: ${{ steps.release.outputs.release_created }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
if: ${{ steps.release.outputs.release_created }}