chore: make the linter great again #15
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: | |
- 'v*.*.*' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
id-token: write | |
packages: write | |
jobs: | |
prepare: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
env: | |
flags: "" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: 1.19 | |
cache: true | |
- shell: bash | |
run: | | |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
if: matrix.os == 'ubuntu-latest' | |
with: | |
path: dist/linux | |
key: linux-${{ env.sha_short }} | |
- uses: actions/cache@v3 | |
if: matrix.os == 'macos-latest' | |
with: | |
path: dist/darwin | |
key: darwin-${{ env.sha_short }} | |
- uses: actions/cache@v3 | |
if: matrix.os == 'windows-latest' | |
with: | |
path: dist/windows | |
key: windows-${{ env.sha_short }} | |
enableCrossOsArchive: true | |
- if: ${{ github.event_name == 'workflow_dispatch' }} | |
shell: bash | |
run: echo "flags=--nightly" >> $GITHUB_ENV | |
- if: matrix.os == 'windows-latest' | |
shell: bash | |
run: echo "flags=--skip-before" >> $GITHUB_ENV # skip before hooks on windows (shell scripts for manpages and completions) | |
- uses: goreleaser/goreleaser-action@v4 | |
if: steps.cache.outputs.cache-hit != 'true' # do not run if cache hit | |
with: | |
distribution: goreleaser-pro | |
version: latest | |
args: release --clean --split ${{ env.flags }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | |
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} | |
FURY_TOKEN: ${{ secrets.FURY_TOKEN }} | |
AUR_KEY: ${{ secrets.AUR_KEY }} | |
release: | |
runs-on: ubuntu-latest | |
needs: prepare | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: 1.19 | |
cache: true | |
# copy the cashes from prepare | |
- shell: bash | |
run: | | |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
with: | |
path: dist/linux | |
key: linux-${{ env.sha_short }} | |
- uses: actions/cache@v3 | |
with: | |
path: dist/darwin | |
key: darwin-${{ env.sha_short }} | |
- uses: actions/cache@v3 | |
with: | |
path: dist/windows | |
key: windows-${{ env.sha_short }} | |
enableCrossOsArchive: true | |
# release | |
- uses: goreleaser/goreleaser-action@v4 | |
if: steps.cache.outputs.cache-hit != 'true' # do not run if cache hit | |
with: | |
version: latest | |
distribution: goreleaser-pro | |
args: continue --merge | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} | |
FURY_TOKEN: ${{ secrets.FURY_TOKEN }} | |
AUR_KEY: ${{ secrets.AUR_KEY }} | |
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} |