Skip to content

fix: Implement split and merge #33

fix: Implement split and merge

fix: Implement split and merge #33

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
pull_request:
branches: [ "main" ]
permissions:
contents: write
id-token: write
packages: write
jobs:
prepare:
name: Prepare
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
cache: true
- shell: bash
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- uses: actions/cache@v4
if: matrix.os == 'ubuntu-latest'
with:
path: dist/linux
key: linux-${{ env.sha_short }}${{ env.flags }}
- uses: actions/cache@v4
if: matrix.os == 'macos-latest'
with:
path: dist/darwin
key: darwin-${{ env.sha_short }}${{ env.flags }}
- uses: actions/cache@v4
if: matrix.os == 'windows-latest'
with:
path: dist/windows
key: windows-${{ env.sha_short }}${{ env.flags }}
enableCrossOsArchive: true
- name: Import GPG key
uses: crazy-max/[email protected]
id: import_gpg
with:
gpg_private_key: ${{ secrets.PLURAL_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PLURAL_GPG_KEY_PASSWORD }}
- uses: goreleaser/goreleaser-action@v6
with:
args: release --clean --split
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
release:
name: Release
runs-on: ubuntu-latest
needs: prepare
steps:
- uses: jlumbroso/[email protected]
with:
tool-cache: false
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
cache: true
- shell: bash
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
path: dist/linux
key: linux-${{ env.sha_short }}${{ env.flags }}
- uses: actions/cache@v4
with:
path: dist/darwin
key: darwin-${{ env.sha_short }}${{ env.flags }}
- uses: actions/cache@v4
with:
path: dist/windows
key: windows-${{ env.sha_short }}${{ env.flags }}
enableCrossOsArchive: true
- name: Import GPG key
uses: crazy-max/[email protected]
id: import_gpg
with:
gpg_private_key: ${{ secrets.PLURAL_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PLURAL_GPG_KEY_PASSWORD }}
- uses: goreleaser/goreleaser-action@v6
if: steps.cache.outputs.cache-hit != 'true' # do not run if cache hit
with:
args: continue --merge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}