Skip to content

Release

Release #12

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
tag:
description: 'Release tag (i.e. v1.2.3)'
required: true
type: string
permissions:
contents: write
jobs:
Release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
with:
fetch-depth: 0
- name: Fetch Version
id: version
run: |
PLUGIN_VERSION=v$(cat plugin.yaml | grep "version" | cut -d '"' -f 2)
echo "::set-output name=PLUGIN_VERSION::$PLUGIN_VERSION"
- name: Check Version
if: ${{ steps.version.outputs.PLUGIN_VERSION != inputs.tag }}
run: echo "Plugin version does not match input tag. Please make sure you have prepared the release first." && exit 1
- name: Set Golang
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: 1.21
- name: Build
run: make build
- name: Create tag
run: git tag ${{ github.event.inputs.tag }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7 # v4.3.0
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}