Skip to content

Release

Release #13

Workflow file for this run

name: Release
# This GitHub action creates a release when a tag that matches the pattern
# "v*" (e.g. v0.1.0) is created.
on:
push:
tags:
- 'v*'
# GitHub considers creating releases and uploading assets as writing contents.
permissions:
contents: write
env:
GO_VERSION: '1.18'
jobs:
tests:
uses: ./.github/workflows/test.yml
goreleaser:
runs-on: ubuntu-latest
needs: tests
steps:
- uses: actions/checkout@v3
with:
# Allow goreleaser to access older tag information.
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Import GPG key
shell: bash
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
echo "import gpg key.."
echo -e "${{env.GPG_PRIVATE_KEY}}" | gpg --import --batch --no-tty
echo "testing key" >temp.txt
gpg --detach-sig --yes -v --output=/dev/null --pinentry-mode loopback --passphrase "${{ env.GPG_PASSPHRASE }}" temp.txt
rm temp.txt
- name: Set GPG fingerprint output
id: gpg-fingerprint
run: |
fingerprint=$(gpg --with-colons --list-keys | awk -F: '/^pub/ { print $5 }')
echo "::set-output name=fingerprint::$fingerprint"
shell: bash
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2.9.1
with:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.gpg-fingerprint.outputs.fingerprint }}