-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (60 loc) · 1.86 KB
/
golang_release.yml
File metadata and controls
64 lines (60 loc) · 1.86 KB
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
# Golang module release management
name: Release Management
on:
workflow_call:
env:
# Go language version to use.
GO_VERSION: '1.19'
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release_please.outputs.release_created }}
steps:
- name: DevOpsArrBOT token
id: DevOpsArrBOT
uses: getsentry/action-github-app-token@v3
with:
app_id: '305652'
private_key: ${{ secrets.DEVOPSARRBOT_PRIVATE_KEY }}
- name: app name
id: app-name
run: |
app=${{ github.repository }} &&\
echo "name=$(echo $app | sed -e 's%.*/%%g' -e 's%-.*%%g')" >> $GITHUB_OUTPUT
- uses: actions/checkout@v5
with:
# Allow access to older tag information.
fetch-depth: 0
token: ${{ steps.DevOpsArrBOT.outputs.token }}
- uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
- name: Release Please
id: release_please
uses: google-github-actions/release-please-action@v4
with:
release-type: go
token: ${{ steps.DevOpsArrBOT.outputs.token }}
extra-files: |
README.md
${{ steps.app-name.outputs.name }}/configuration.go
gorelease:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
steps:
- uses: actions/checkout@v5
with:
# Allow access to older tag information.
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6.1.0
with:
args: release --clean
env:
# GitHub sets the GITHUB_TOKEN secret automatically.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}