chore: update goreleaser config #12
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: goreleaser | |
on: | |
push: | |
tags: | |
- '*' | |
permissions: | |
contents: write | |
jobs: | |
changelog: | |
name: Generate changelog | |
runs-on: ubuntu-latest | |
needs: goreleaser | |
outputs: | |
release_body: ${{ steps.release.outputs.RELEASE_BODY }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Generate a changelog | |
uses: orhun/git-cliff-action@v3 | |
id: git-cliff | |
with: | |
config: cliff.toml | |
args: -vv --latest --strip header | |
env: | |
OUTPUT: CHANGES.md | |
- name: Set the release body | |
id: release | |
shell: bash | |
run: | | |
r=$(cat ${{ steps.git-cliff.outputs.changelog }}) | |
r="${r//'%'/'%25'}" # Multiline escape sequences for % | |
r="${r//$'\n'/'%0A'}" # Multiline escape sequences for '\n' | |
r="${r//$'\r'/'%0D'}" # Multiline escape sequences for '\r' | |
echo "::set-output name=RELEASE_BODY::$r" | |
goreleaser: | |
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: 1.21 | |
- | |
name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
# either 'goreleaser' (default) or 'goreleaser-pro' | |
distribution: goreleaser | |
version: latest | |
args: release --rm-dist | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} | |
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution | |
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} | |
update_release: | |
name: Update release body | |
needs: changelog | |
runs-on: ubuntu-latest | |
steps: | |
- name: update release | |
id: update_release | |
uses: tubone24/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
body: ${{ needs.changelog.outputs.release_body }} | |
isAppendBody: true |