Skip to content

Commit 211d292

Browse files
authored
Merge pull request #171 from turkenf/publish-ghcr
Update Go version and enable pushing to ghcr.io in CI
2 parents bd34dfc + 3178955 commit 211d292

File tree

3 files changed

+19
-30
lines changed

3 files changed

+19
-30
lines changed

.github/workflows/ci.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414

1515
env:
1616
# Common versions
17-
GO_VERSION: '1.23.4'
17+
GO_VERSION: '1.23.6'
1818
GOLANGCI_VERSION: 'v1.62.2'
1919
DOCKER_BUILDX_VERSION: 'v0.11.2'
2020

@@ -31,6 +31,7 @@ env:
3131
# The package to push, without a version tag. The default matches GitHub. For
3232
# example xpkg.upbound.io/crossplane/function-template-go.
3333
XPKG: xpkg.upbound.io/${{ github.repository}}
34+
CROSSPLANE_REGORG: ghcr.io/${{ github.repository}} # xpkg.crossplane.io/crossplane-contrib
3435

3536
# The package version to push. The default is 0.0.0-gitsha.
3637
XPKG_VERSION: ${{ inputs.version }}
@@ -165,3 +166,14 @@ jobs:
165166
- name: Push Multi-Platform Package to Upbound
166167
if: env.XPKG_ACCESS_ID != ''
167168
run: "./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.XPKG }}:${{ env.XPKG_VERSION }}"
169+
170+
- name: Login to GHCR
171+
uses: docker/[email protected]
172+
with:
173+
registry: ghcr.io
174+
username: ${{ github.repository_owner }}
175+
password: ${{ secrets.GITHUB_TOKEN }}
176+
177+
- name: Push Multi-Platform Package to GHCR
178+
if: env.XPKG_ACCESS_ID != ''
179+
run: "./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.CROSSPLANE_REGORG }}:${{ env.XPKG_VERSION }}"

.golangci.yml

+5-26
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
run:
22
timeout: 10m
33

4-
skip-files:
5-
- "zz_generated\\..+\\.go$"
6-
74
output:
85
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
9-
format: colored-line-number
6+
formats:
7+
- format: colored-line-number
108

119
linters-settings:
1210
errcheck:
@@ -18,15 +16,6 @@ linters-settings:
1816
# default is false: such cases aren't reported by default.
1917
check-blank: false
2018

21-
# [deprecated] comma-separated list of pairs of the form pkg:regex
22-
# the regex is used to ignore names within pkg. (default "fmt:.*").
23-
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
24-
ignore: fmt:.*,io/ioutil:^Read.*
25-
26-
govet:
27-
# report about shadowed variables
28-
check-shadowing: false
29-
3019
gofmt:
3120
# simplify code: gofmt with `-s` option, true by default
3221
simplify: true
@@ -46,10 +35,6 @@ linters-settings:
4635
# minimal code complexity to report, 30 by default (but we recommend 10-20)
4736
min-complexity: 10
4837

49-
maligned:
50-
# print struct with more effective memory layout or not, false by default
51-
suggest-new: true
52-
5338
dupl:
5439
# tokens count to trigger issue, 150 by default
5540
threshold: 100
@@ -64,13 +49,6 @@ linters-settings:
6449
# tab width in spaces. Default to 1.
6550
tab-width: 1
6651

67-
unused:
68-
# treat code as a program (not a library) and report unused exported identifiers; default is false.
69-
# XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
70-
# if it's called for subdir of a project it can't find funcs usages. All text editor integrations
71-
# with golangci-lint call it on a directory with the changed file.
72-
check-exported: false
73-
7452
unparam:
7553
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
7654
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
@@ -111,7 +89,6 @@ linters-settings:
11189

11290
linters:
11391
enable:
114-
- megacheck
11592
- govet
11693
- gocyclo
11794
- gocritic
@@ -141,6 +118,8 @@ linters:
141118

142119

143120
issues:
121+
exclude-files:
122+
- "zz_generated\\..+\\.go$"
144123
# Excluding configuration per-path and per-linter
145124
exclude-rules:
146125
# Exclude some linters from running on tests files.
@@ -210,7 +189,7 @@ issues:
210189
new: false
211190

212191
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
213-
max-per-linter: 0
192+
max-issues-per-linter: 0
214193

215194
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
216195
max-same-issues: 0

go.mod

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/crossplane-contrib/function-patch-and-transform
22

3-
go 1.23
4-
5-
toolchain go1.23.4
3+
go 1.23.6
64

75
require (
86
github.com/alecthomas/kong v0.9.0

0 commit comments

Comments
 (0)