From 9bd581be6eba098c9c1bc6ac91bcb924dba2bc6a Mon Sep 17 00:00:00 2001 From: Daniel Jaglowski Date: Tue, 18 Jun 2024 10:14:29 -0500 Subject: [PATCH] Add goreleaser check and attempt update (#10428) https://github.com/open-telemetry/opentelemetry-collector/pull/10384 updated `goreleaser` to a new major version and this appears to have [broken the config](https://github.com/open-telemetry/opentelemetry-collector/actions/runs/9565775767/job/26369463094). This problem only became apparent during the release process since the config is not used otherwise. This PR adds a github action to run `goreleaser check` on all PRs, since changes to the config may not be caught until release is attempted. I've also included what may be the only necessary change to the config, by [renaming `changelog.skip` to `changelog.disable`](https://github.com/goreleaser/goreleaser/commit/29f30b623ef8f0a19607afab22b3f3a2f9f68172). This passes `goreleaser check` when run locally. The `monorepo` section of the config fails locally, but the feature appears to require the Pro version so I'm unclear if it will pass with the OSS version. --- .github/workflows/check-goreleaser.yaml | 29 +++++++++++++++++++++++++ cmd/builder/.goreleaser.yml | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/check-goreleaser.yaml diff --git a/.github/workflows/check-goreleaser.yaml b/.github/workflows/check-goreleaser.yaml new file mode 100644 index 00000000000..6f25384f229 --- /dev/null +++ b/.github/workflows/check-goreleaser.yaml @@ -0,0 +1,29 @@ +name: Check GoReleaser Config +on: + push: + branches: [main] + tags: + - "v[0-9]+.[0-9]+.[0-9]+*" + pull_request: + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + with: + fetch-depth: 0 + - name: Setup Go + uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 + with: + go-version: ~1.21.5 + - name: Check GoReleaser + uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0 + with: + distribution: goreleaser-pro + version: latest + args: check --verbose cmd/builder/.goreleaser.yml + env: + GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/cmd/builder/.goreleaser.yml b/cmd/builder/.goreleaser.yml index 7cb52fa0ffa..a964ac6c6ee 100644 --- a/cmd/builder/.goreleaser.yml +++ b/cmd/builder/.goreleaser.yml @@ -36,4 +36,4 @@ checksum: snapshot: name_template: "{{ .Tag }}-next" changelog: - skip: true + disable: true