Skip to content

Commit

Permalink
Merge pull request #171 from turkenf/publish-ghcr
Browse files Browse the repository at this point in the history
Update Go version and enable pushing to ghcr.io in CI
  • Loading branch information
turkenf authored Feb 24, 2025
2 parents bd34dfc + 3178955 commit 211d292
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 30 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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 }}
Expand Down Expand Up @@ -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 }}"
31 changes: 5 additions & 26 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -111,7 +89,6 @@ linters-settings:

linters:
enable:
- megacheck
- govet
- gocyclo
- gocritic
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 211d292

Please sign in to comment.