Skip to content

release

release #2

Workflow file for this run

---
name: release
permissions:
contents: write
on:
workflow_dispatch:
inputs:
version:
description: "Release version (e.g., v1.0.0)"
required: true
jobs:
run:
name: Release
runs-on: ubuntu-latest
container:
image: goreleaser/goreleaser:latest
steps:
- name: Install dependencies
run: apk add --no-cache bash ncurses git
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
git config --global --add safe.directory "$PWD"
git fetch --force --tags
- name: Create release tag
run: |
git config --global user.email "[email protected]"
git config --global user.name "Michael Henriksen"
git tag -a "$VERSION" -m "$VERSION"
env:
VERSION: ${{ github.event.inputs.version }}
- run: echo "GO_VERSION=$(go env GOVERSION)" >> "$GITHUB_ENV"
- name: Run GoReleaser
run: goreleaser release --clean
env:
VERSION: ${{ github.event.inputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Notify Go proxy about new release
run: go list -m "github.com/michenriksen/tmpl@${VERSION}" || true
env:
GOPROXY: proxy.golang.org
VERSION: ${{ github.event.inputs.version }}