forked from keycloak/terraform-provider-keycloak
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (59 loc) · 1.96 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
61
62
63
64
65
66
name: release
on:
push:
tags:
- "v*"
jobs:
wait:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-24.04
name: Wait for acceptance tests
steps:
- name: Wait for acceptance tests
id: wait
uses: "WyriHaximus/github-action-wait-for-status@v1.8.0"
with:
ignoreActions: Wait for acceptance tests
checkInterval: 30
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:
status: steps.wait.outputs.status
release:
permissions: write-all
needs:
- wait
runs-on: ubuntu-24.04
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Get tag name
id: get_tag_name
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/}
- name: Build release notes link
id: build-release-notes
run: |
releaseDate=$(date '+%B-%-d-%Y' | tr '[:upper:]' '[:lower:]')
releaseVersion=$(echo ${{ steps.get_tag_name.outputs.TAG }} | tr -d '.')
tmp=$(mktemp -d)
echo "[Release Notes](https://github.com/keycloak/terraform-provider-keycloak/blob/main/CHANGELOG.md#${releaseVersion}-${releaseDate})" > ${tmp}/release-notes.md
cat ${tmp}/release-notes.md
echo ::set-output name=NOTES::${tmp}/release-notes.md
- name: GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
args: release --clean --release-notes=${{ steps.build-release-notes.outputs.NOTES }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}