forked from keycloak/terraform-provider-keycloak
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (43 loc) · 1.58 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
name: release
on:
push:
tags:
- "v*"
jobs:
release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Wait for CircleCI tests
uses: "WyriHaximus/github-action-wait-for-status@v1.1.2"
with:
ignoreActions: release
checkInterval: 30
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v2
env:
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/mrparkers/terraform-provider-keycloak/blob/master/CHANGELOG.md#${releaseVersion}-${releaseDate})" > ${tmp}/release-notes.md
echo ::set-output name=NOTES::${tmp}/release-notes.md
- name: GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist --release-notes=${{ steps.build_release_notes.outputs.NOTES }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}