Ensure inputs are validated #29
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create release | |
permissions: | |
contents: write | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "The release version" | |
required: true | |
type: string | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: release | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.22 | |
- name: Tag version | |
if: github.event_name == 'workflow_dispatch' | |
run: | | |
git fetch --force --tags | |
git tag --force ${{ github.event.inputs.version }} | |
- name: Run GoReleaser | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} |