14
14
15
15
env :
16
16
# Common versions
17
- GO_VERSION : ' 1.21.3 '
18
- GOLANGCI_VERSION : ' v1.54.2 '
19
- DOCKER_BUILDX_VERSION : ' v0.11.2 '
17
+ GO_VERSION : ' 1.23.8 '
18
+ GOLANGCI_VERSION : ' v1.62.0 '
19
+ DOCKER_BUILDX_VERSION : ' v0.23.0 '
20
20
21
21
# These environment variables are important to the Crossplane CLI install.sh
22
22
# script. They determine what version it installs.
31
31
# The package to push, without a version tag. The default matches GitHub. For
32
32
# example xpkg.upbound.io/crossplane/function-template-go.
33
33
XPKG : xpkg.upbound.io/${{ github.repository}}
34
+ CROSSPLANE_REGORG : ghcr.io/${{ github.repository}} # xpkg.crossplane.io/crossplane-contrib
34
35
35
36
# The package version to push. The default is 0.0.0-gitsha.
36
37
XPKG_VERSION : ${{ inputs.version }}
@@ -40,14 +41,17 @@ jobs:
40
41
runs-on : ubuntu-24.04
41
42
steps :
42
43
- name : Checkout
43
- uses : actions/checkout@v4
44
+ uses : actions/checkout@v5
44
45
45
46
- name : Setup Go
46
47
uses : actions/setup-go@v5
47
48
with :
48
49
go-version : ${{ env.GO_VERSION }}
49
50
cache : false # The golangci-lint action does its own caching.
50
51
52
+ - name : Check go mod tidy
53
+ run : go mod tidy && git diff --exit-code go.mod go.sum
54
+
51
55
- name : Lint
52
56
uses : golangci/golangci-lint-action@v6
53
57
with :
57
61
runs-on : ubuntu-24.04
58
62
steps :
59
63
- name : Checkout
60
- uses : actions/checkout@v4
64
+ uses : actions/checkout@v5
61
65
62
66
- name : Setup Go
63
67
uses : actions/setup-go@v5
70
74
# We want to build most packages for the amd64 and arm64 architectures. To
71
75
# speed this up we build single-platform packages in parallel. We then upload
72
76
# those packages to GitHub as a build artifact. The push job downloads those
73
- # artifacts and pushes them as a single multi-platform package.
77
+ # artifacts and pushes them as a single multi-platform package.
74
78
build :
75
79
runs-on : ubuntu-24.04
76
80
strategy :
92
96
install : true
93
97
94
98
- name : Checkout
95
- uses : actions/checkout@v4
99
+ uses : actions/checkout@v5
96
100
97
101
# We ask Docker to use GitHub Action's native caching support to speed up
98
102
# the build, per https://docs.docker.com/build/cache/backends/gha/.
@@ -108,13 +112,13 @@ jobs:
108
112
build-args :
109
113
GO_VERSION=${{ env.GO_VERSION }}
110
114
outputs : type=docker,dest=runtime-${{ matrix.arch }}.tar
111
-
115
+
112
116
- name : Setup the Crossplane CLI
113
117
run : " curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh"
114
118
115
119
- name : Build Package
116
120
run : ./crossplane xpkg build --package-file=${{ matrix.arch }}.xpkg --package-root=package/ --embed-runtime-image-tarball=runtime-${{ matrix.arch }}.tar
117
-
121
+
118
122
- name : Upload Single-Platform Package
119
123
uses : actions/upload-artifact@v4
120
124
with :
@@ -132,13 +136,14 @@ jobs:
132
136
- build
133
137
steps :
134
138
- name : Checkout
135
- uses : actions/checkout@v4
139
+ uses : actions/checkout@v5
136
140
137
141
- name : Download Single-Platform Packages
138
- uses : actions/download-artifact@v4
142
+ uses : actions/download-artifact@v5
139
143
with :
140
144
path : .
141
145
merge-multiple : true
146
+ pattern : " !*.dockerbuild" # This gets uploaded by docker/build-push-action but must be skipped: https://github.com/actions/toolkit/pull/1874
142
147
143
148
- name : Setup the Crossplane CLI
144
149
run : " curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh"
@@ -162,3 +167,14 @@ jobs:
162
167
- name : Push Multi-Platform Package to Upbound
163
168
if : env.XPKG_ACCESS_ID != ''
164
169
run : " ./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.XPKG }}:${{ env.XPKG_VERSION }}"
170
+
171
+ - name : Login to GHCR
172
+
173
+ with :
174
+ registry : ghcr.io
175
+ username : ${{ github.repository_owner }}
176
+ password : ${{ secrets.GITHUB_TOKEN }}
177
+
178
+ - name : Push Multi-Platform Package to GHCR
179
+ if : env.XPKG_ACCESS_ID != ''
180
+ run : " ./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.CROSSPLANE_REGORG }}:${{ env.XPKG_VERSION }}"
0 commit comments