.github/workflows/release.yml
name: Semantic Release
on:
push:
branches:
- master
jobs:
release:
name: Semantic Release
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
- name: Restore Node cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- name: Setup Go
uses: actions/setup-go@v2
- name: Restore Go cache
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
# Blank version number means latest version of Go.
key: ${{ runner.os }}-go-v-${{ hashFiles('**/go.sum') }}
- name: Import GPG key
id: import_gpg
uses: paultyng/ghaction-import-gpg@v2.1.0
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: 'v1.26.2'
install-only: true
- name: Install dependencies
run: npm ci
- name: semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
run: npx semantic-release
- uses: hashicorp/setup-terraform@v1
with:
terraform_wrapper: false
terraform_version: "${{ matrix.terraform }}"
- name: Sleep for 30 seconds
uses: jakejarvis/wait-action@master
with:
time: '30s'
- name: Confirm install from Registry
working-directory: ./example
run: terraform init