Skip to content

Release

Release #107

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
newVersionTag:
description: 'New version tag (e.g. v0.10.11)'
required: true
jobs:
release:
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ steps.app-token.outputs.token }}
- 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 auto-changelog@2.3.0
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 github-actions@github.com
- 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.25.1"
args: release --clean
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}