From 581635c187793453e1d7fdc46f3acbcaf8d7a809 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Wed, 5 Jun 2024 21:42:15 +0200 Subject: [PATCH] Fix go releaser (#105) * Fix go releaser * Fix go releaser --- .github/workflows/shared-go-auto-release.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/shared-go-auto-release.yml b/.github/workflows/shared-go-auto-release.yml index fae99297..91ed0e7d 100644 --- a/.github/workflows/shared-go-auto-release.yml +++ b/.github/workflows/shared-go-auto-release.yml @@ -151,12 +151,20 @@ jobs: run: |- if [ -f .goreleaser.yml ]; then echo 'Go releaser config exists.' - echo "path=./.goreleaser.yml" >> $GITHUB_OUTPUT + GORELEASER_CONFIG="./.goreleaser.yml" else echo 'Go releaser config does not exist. Use org wide config' - echo "path=../.configs/.github/goreleaser.yml" >> $GITHUB_OUTPUT + GORELEASER_CONFIG="../.configs/.github/goreleaser.yml" fi + if [[ "${{ inputs.format }}" == "binary" ]]; then + sed -i 's/{{ .Env.ARCHIVES_FORMAT }}/binary/g' $GORELEASER_CONFIG + elif [[ "${{ inputs.format }}" == "zip" ]]; then + sed -i 's/{{ .Env.ARCHIVES_FORMAT }}/zip/g' $GORELEASER_CONFIG + fi + + echo "path=./${$GORELEASER_CONFIG}" >> $GITHUB_OUTPUT + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 with: @@ -164,7 +172,6 @@ jobs: version: latest args: release --config ${{ steps.go-releaser-config.outputs.path }} --clean --parallelism 2 --timeout 180m env: - ARCHIVES_FORMAT: ${{ inputs.format }} GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} GITHUB_TOKEN: ${{ steps.github-app.outputs.token }}