From 2651b49048950c5473b1f533c900d17614bc6aa0 Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Wed, 8 Oct 2025 16:10:04 +0200 Subject: [PATCH] updates on ci, use go1.25 and update deprecated goreleaser steps (#779) * updates on ci, use go1.25 and update deprecated goreleaser steps Signed-off-by: Carlos Panato * add nolint Signed-off-by: Carlos Panato --------- Signed-off-by: Carlos Panato --- .github/workflows/ci.yaml | 34 +++++++++++++++-- .github/workflows/release.yaml | 5 ++- .github/workflows/stale.yaml | 2 + .goreleaser.yml | 69 ++++++++++------------------------ Dockerfile | 3 +- pkg/util/util_test.go | 2 +- 6 files changed, 58 insertions(+), 57 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2764b27..c29200a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -6,15 +6,23 @@ on: pull_request: branches: - '*' + +permissions: {} + jobs: build: runs-on: ubuntu-latest + + permissions: + contents: read + steps: - name: checkout uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 + persist-credentials: false - name: shellcheck uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0 @@ -22,8 +30,9 @@ jobs: - name: Setup go uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 with: - go-version-file: './go.mod' + go-version: '1.25' check-latest: true + cache: false - uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1 @@ -79,12 +88,20 @@ jobs: check-docs: name: check-docs runs-on: ubuntu-latest + + permissions: + contents: read + steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + persist-credentials: false + - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 with: - go-version-file: './go.mod' + go-version: '1.25' check-latest: true + cache: false - name: generate docs run: | @@ -100,13 +117,22 @@ jobs: golangci: name: lint runs-on: ubuntu-latest + + permissions: + contents: read + steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + persist-credentials: false + - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 with: - go-version-file: './go.mod' + go-version: '1.25' check-latest: true + cache: false + - name: golangci-lint uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 with: - version: v2.1 + version: v2.5 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9045a3d..3d060b9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,6 +6,8 @@ on: description: Version required: true +permissions: {} + jobs: build: runs-on: ubuntu-latest @@ -27,8 +29,9 @@ jobs: - name: Setup go uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 with: - go-version-file: './go.mod' + go-version: '1.25' check-latest: true + cache: false - name: Install GoReleaser uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml index 5162105..8933c72 100644 --- a/.github/workflows/stale.yaml +++ b/.github/workflows/stale.yaml @@ -3,6 +3,8 @@ on: schedule: - cron: '30 1 * * *' +permissions: {} + jobs: stale: runs-on: ubuntu-latest diff --git a/.goreleaser.yml b/.goreleaser.yml index 45361eb..e63a6f6 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -24,6 +24,9 @@ builds: - linux - darwin - windows + ignore: + - goarch: arm + goos: windows flags: - -trimpath mod_timestamp: '{{ .CommitTimestamp }}' @@ -50,58 +53,25 @@ checksum: snapshot: version_template: "{{ .Tag }}-next" -dockers: - - skip_push: false - use: buildx - dockerfile: Dockerfile - image_templates: - - quay.io/helmpack/chart-testing:{{ .Tag }}-amd64 - - quay.io/helmpack/chart-testing:latest-amd64 - build_flag_templates: - - --platform=linux/amd64 - - --label=org.opencontainers.image.version={{ .Version }} - - --label=org.opencontainers.image.revision={{ .Commit }} - - --label=org.opencontainers.image.title={{ .ProjectName }} - - --label=org.opencontainers.image.created={{ .Date }} - - --label=org.opencontainers.image.description=ct - The chart testing tool - - --label=org.opencontainers.image.vendor=Helm - - --label=org.opencontainers.image.licenses=Apache-2.0 - - --label=org.opencontainers.image.source=https://github.com/helm/chart-testing - - --label=org.opencontainers.image.authors=The Helm Authors +dockers_v2: + - images: + - "quay.io/helmpack/chart-testing" + tags: + - "{{ .Tag }}" + - "latest" + labels: + "org.opencontainers.image.version": "{{ .Version }}" + "org.opencontainers.image.revision": "{{ .Commit }}" + "org.opencontainers.image.title": "{{ .ProjectName }}" + "org.opencontainers.image.created": "{{ .Date }}" + "org.opencontainers.image.description": "ct - The chart testing tool" + "org.opencontainers.image.vendor": "Helm" + "org.opencontainers.image.licenses": "Apache-2.0" + "org.opencontainers.image.source": "https://github.com/helm/chart-testing" + "org.opencontainers.image.authors": "The Helm Authors" extra_files: - etc/chart_schema.yaml - etc/lintconf.yaml - - skip_push: false - goarch: arm64 - use: buildx - dockerfile: Dockerfile - image_templates: - - quay.io/helmpack/chart-testing:{{ .Tag }}-arm64 - - quay.io/helmpack/chart-testing:latest-arm64 - build_flag_templates: - - --platform=linux/arm64 - - --label=org.opencontainers.image.version={{ .Version }} - - --label=org.opencontainers.image.revision={{ .Commit }} - - --label=org.opencontainers.image.title={{ .ProjectName }} - - --label=org.opencontainers.image.created={{ .Date }} - - --label=org.opencontainers.image.description=ct - The chart testing tool - - --label=org.opencontainers.image.vendor=Helm - - --label=org.opencontainers.image.licenses=Apache-2.0 - - --label=org.opencontainers.image.source=https://github.com/helm/chart-testing - - --label=org.opencontainers.image.authors=The Helm Authors - extra_files: - - etc/chart_schema.yaml - - etc/lintconf.yaml - -docker_manifests: - - name_template: quay.io/helmpack/chart-testing:latest - image_templates: - - quay.io/helmpack/chart-testing:latest-amd64 - - quay.io/helmpack/chart-testing:latest-arm64 - - name_template: quay.io/helmpack/chart-testing:{{ .Tag }} - image_templates: - - quay.io/helmpack/chart-testing:{{ .Tag }}-amd64 - - quay.io/helmpack/chart-testing:{{ .Tag }}-arm64 signs: - id: all @@ -115,7 +85,6 @@ docker_signs: - id: images cmd: cosign args: ["sign", "${artifact}"] - artifacts: manifests changelog: use: github-native diff --git a/Dockerfile b/Dockerfile index a53e7d0..06030bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,6 +47,7 @@ fi \ COPY ./etc/chart_schema.yaml /etc/ct/chart_schema.yaml COPY ./etc/lintconf.yaml /etc/ct/lintconf.yaml -COPY ct /usr/local/bin/ct +ARG TARGETPLATFORM +COPY $TARGETPLATFORM/ct /usr/local/bin/ct # Ensure that the binary is available on path and is executable RUN ct --help diff --git a/pkg/util/util_test.go b/pkg/util/util_test.go index 2ff022f..6cdd9ab 100644 --- a/pkg/util/util_test.go +++ b/pkg/util/util_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package util +package util //nolint: revive import ( "fmt"