-
Notifications
You must be signed in to change notification settings - Fork 56
71 lines (60 loc) · 2.04 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
67
68
69
70
71
name: Release
on:
workflow_dispatch:
inputs:
newVersionTag:
description: 'New version tag (e.g. v0.10.11)'
required: true
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.20.x
- name: Install and run tfplugindocs CLI
run: |
mkdir downloads
cd downloads
wget https://github.com/hashicorp/terraform-plugin-docs/releases/download/v0.13.0/tfplugindocs_0.13.0_linux_amd64.zip
unzip tfplugindocs_0.13.0_linux_amd64.zip
cd ..
mv downloads/tfplugindocs .
./tfplugindocs generate
rm -rf ./tfplugindocs downloads
- name: Install and run auto-changelog CLI
run: |
npm i -g [email protected]
auto-changelog --config=.auto-changelog-config --latest-version=${{ github.event.inputs.newVersionTag }}
- name: Setup Git config
run: |
git config user.name "GitHub Actions"
git config user.email "<>"
- name: Add and commit generated files
run: |
git add .
git commit -m "Update docs and CHANGELOG.md"
- name: Create a tag and push
run: |
git pull -r origin master
git tag -a ${{ github.event.inputs.newVersionTag }} -m ""
git push origin master --follow-tags
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: "1.18.2"
args: release --clean
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}