diff --git a/.github/workflows/shared-go-auto-release.yml b/.github/workflows/shared-go-auto-release.yml index fae9929..91ed0e7 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 }}