From 6d70578015c00610fa0eaa9b107bbb01fefc514f Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Mon, 18 Nov 2024 16:22:24 -0800 Subject: [PATCH] feat: goreleaser debug logs (#15272) --- .../goreleaser-build-sign-publish/action.yml | 14 ++++++++++++++ .../goreleaser-build-sign-publish/release.js | 5 +++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/actions/goreleaser-build-sign-publish/action.yml b/.github/actions/goreleaser-build-sign-publish/action.yml index c57bff91488..fa72216d70d 100644 --- a/.github/actions/goreleaser-build-sign-publish/action.yml +++ b/.github/actions/goreleaser-build-sign-publish/action.yml @@ -26,19 +26,32 @@ inputs: description: "The goreleaser configuration yaml" default: ".goreleaser.yaml" required: false + # other inputs + enable-debug: + description: | + Enable debug information for the run (true/false). This includes + buildkit debug information, and goreleaser debug, etc. + required: false + default: "${{ runner.debug == '1' }}" + runs: using: composite steps: - # We need QEMU to test the cross architecture builds after they're built. name: Set up QEMU uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 + - name: Setup docker buildx uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.0 + with: + buildkitd-flags: ${{ inputs.enable-debug == 'true' && '--debug' || '' }} + - name: Set up Go uses: ./.github/actions/setup-go with: go-version-file: 'go.mod' only-modules: 'true' + - name: Setup goreleaser uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0 with: @@ -65,6 +78,7 @@ runs: IMAGE_TAG: ${{ inputs.docker-image-tag }} GORELEASER_KEY: ${{ inputs.goreleaser-key }} GITHUB_TOKEN: ${{ github.token }} + DEBUG: ${{ inputs.enable-debug }} run: | # https://github.com/orgs/community/discussions/24950 ${GITHUB_ACTION_PATH}/release.js diff --git a/.github/actions/goreleaser-build-sign-publish/release.js b/.github/actions/goreleaser-build-sign-publish/release.js index 0dbd58ca6cf..cd0521c991e 100755 --- a/.github/actions/goreleaser-build-sign-publish/release.js +++ b/.github/actions/goreleaser-build-sign-publish/release.js @@ -168,6 +168,7 @@ function extractDockerImages(artifacts) { function constructGoreleaserCommand(releaseType, version, goreleaserConfig) { const flags = []; + const debugFlag = (process.env.DEBUG == 'true') ? '--verbose' : ''; checkReleaseType(releaseType); @@ -192,9 +193,9 @@ function constructGoreleaserCommand(releaseType, version, goreleaserConfig) { const flagsStr = flags.join(" "); if (releaseType === "merge") { - return `CHAINLINK_VERSION=${version} goreleaser ${subCmd} ${flagsStr}`; + return `CHAINLINK_VERSION=${version} goreleaser ${debugFlag} ${subCmd} ${flagsStr}`; } else { - return `CHAINLINK_VERSION=${version} goreleaser ${subCmd} --config ${goreleaserConfig} ${flagsStr}`; + return `CHAINLINK_VERSION=${version} goreleaser ${debugFlag} ${subCmd} --config ${goreleaserConfig} ${flagsStr}`; } }