Skip to content

Update CI/Release Github Action #118

Update CI/Release Github Action

Update CI/Release Github Action #118

Workflow file for this run

# refer: https://github.com/goreleaser/goreleaser
# refer: https://goreleaser.com/
name: release
on:
push:
branches: [ main ]
tags:
- '*'
permissions:
contents: write
packages: write
issues: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch Tags
run: git fetch --force --tags
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '>=1.21.0'
cache: true
# More assembly might be required: Docker logins, GPG, etc. It all depends
# on your needs.
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
# either 'goreleaser' (default) or 'goreleaser-pro':
distribution: goreleaser
version: latest
args: release --rm-dist
env:
# Valid github token with 'repo' scope, used to deploy releases to your github repository.
# // Refer https://docs.github.com/en/actions/security-guides/automatic-token-authentication
# GITHUB_TOKEN is Github App Installation access token. You can use the installation access
# token to authenticate on behalf of the Github App insalled on your repositiory.
# This token's permissions are limited to the repository that contains your workflow
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# If you need to push the homebrew tap to another repository, you must create a custom Personal Access Token (PAT)
# with 'repo' permissions and add it as a secret in the reposiory.
# Refer https://goreleaser.com/ci/actions/
# Refer https://goreleaser.com/customization/homebrew/
TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_REMINDER_GITHUB_TOKEN }}