release #10
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: release | |
permissions: | |
contents: write | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Tag to create' | |
required: true | |
default: 'v0.0.0' | |
type: string | |
jobs: | |
run: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: stable | |
- name: Checkout with tags | |
run: git fetch --prune --unshallow --tags | |
- name: Create release | |
run: | | |
git log --format="%C(auto) %H %s" `git tag --sort=-committerdate | head -1`...HEAD > changelog.txt | |
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token | |
gh release create ${{ github.event.inputs.tag }} -t ${{ github.event.inputs.tag }} -F changelog.txt | |
rm -f changelog.txt | |
git fetch --tags | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |