From 9584aea918bba7df606b0f6e0a048050b264247f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20T=C3=BCrken?= Date: Mon, 24 Feb 2025 19:00:46 +0300 Subject: [PATCH 1/2] Update Go version and enable pushing to ghcr.io in CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fatih Türken --- .github/workflows/ci.yml | 14 +++++++++++++- go.mod | 4 +--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ad290d..20ef208 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ on: env: # Common versions - GO_VERSION: '1.23.4' + GO_VERSION: '1.23.6' GOLANGCI_VERSION: 'v1.62.2' DOCKER_BUILDX_VERSION: 'v0.11.2' @@ -31,6 +31,7 @@ env: # The package to push, without a version tag. The default matches GitHub. For # example xpkg.upbound.io/crossplane/function-template-go. XPKG: xpkg.upbound.io/${{ github.repository}} + CROSSPLANE_REGORG: ghcr.io/${{ github.repository}} # xpkg.crossplane.io/crossplane-contrib # The package version to push. The default is 0.0.0-gitsha. XPKG_VERSION: ${{ inputs.version }} @@ -165,3 +166,14 @@ jobs: - name: Push Multi-Platform Package to Upbound if: env.XPKG_ACCESS_ID != '' run: "./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.XPKG }}:${{ env.XPKG_VERSION }}" + + - name: Login to GHCR + uses: docker/login-action@v3.3.0 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push Multi-Platform Package to GHCR + if: env.XPKG_ACCESS_ID != '' + run: "./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.CROSSPLANE_REGORG }}:${{ env.XPKG_VERSION }}" diff --git a/go.mod b/go.mod index b37847a..2696490 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module github.com/crossplane-contrib/function-patch-and-transform -go 1.23 - -toolchain go1.23.4 +go 1.23.6 require ( github.com/alecthomas/kong v0.9.0 From 42b10e7882d9418e6a94993bf3f71245a2a7cd9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20T=C3=BCrken?= Date: Mon, 24 Feb 2025 19:27:22 +0300 Subject: [PATCH 2/2] Update golangci.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fatih Türken --- .golangci.yml | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 1fd5806..6c417c3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,12 +1,10 @@ run: timeout: 10m - skip-files: - - "zz_generated\\..+\\.go$" - output: # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" - format: colored-line-number + formats: + - format: colored-line-number linters-settings: errcheck: @@ -18,15 +16,6 @@ linters-settings: # default is false: such cases aren't reported by default. check-blank: false - # [deprecated] comma-separated list of pairs of the form pkg:regex - # the regex is used to ignore names within pkg. (default "fmt:.*"). - # see https://github.com/kisielk/errcheck#the-deprecated-method for details - ignore: fmt:.*,io/ioutil:^Read.* - - govet: - # report about shadowed variables - check-shadowing: false - gofmt: # simplify code: gofmt with `-s` option, true by default simplify: true @@ -46,10 +35,6 @@ linters-settings: # minimal code complexity to report, 30 by default (but we recommend 10-20) min-complexity: 10 - maligned: - # print struct with more effective memory layout or not, false by default - suggest-new: true - dupl: # tokens count to trigger issue, 150 by default threshold: 100 @@ -64,13 +49,6 @@ linters-settings: # tab width in spaces. Default to 1. tab-width: 1 - unused: - # treat code as a program (not a library) and report unused exported identifiers; default is false. - # XXX: if you enable this setting, unused will report a lot of false-positives in text editors: - # if it's called for subdir of a project it can't find funcs usages. All text editor integrations - # with golangci-lint call it on a directory with the changed file. - check-exported: false - unparam: # Inspect exported functions, default is false. Set to true if no external program/library imports your code. # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors: @@ -111,7 +89,6 @@ linters-settings: linters: enable: - - megacheck - govet - gocyclo - gocritic @@ -141,6 +118,8 @@ linters: issues: + exclude-files: + - "zz_generated\\..+\\.go$" # Excluding configuration per-path and per-linter exclude-rules: # Exclude some linters from running on tests files. @@ -210,7 +189,7 @@ issues: new: false # Maximum issues count per one linter. Set to 0 to disable. Default is 50. - max-per-linter: 0 + max-issues-per-linter: 0 # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. max-same-issues: 0