1515env :
1616 # Common versions
1717 PYTHON_VERSION : ' 3.14.0' # TODO: Used?
18- HATCH_VERSION : ' 1.14.2 '
18+ HATCH_VERSION : ' v1.29.0 '
1919 DOCKER_BUILDX_VERSION : ' v0.26.1'
2020
2121 # These environment variables are important to the Crossplane CLI install.sh
2222 # script. They determine what version it installs.
2323 XP_CHANNEL : stable
2424 # v2.2.0 does not allow functions to include anything but CRDs.
25- XP_VERSION : v2.1 .0
25+ XP_VERSION : v2.2 .0
2626
2727 # This CI job will automatically push new builds to xpkg.upbound.io if the
2828 # XPKG_ACCESS_ID and XPKG_TOKEN secrets are set in the GitHub respository (or
5252 # with:
5353 # python-version: ${{ env.PYTHON_VERSION }}
5454
55- # - name: Setup Hatch
56- # run: pipx install hatch==$ {{ env.HATCH_VERSION }}
55+ # - name: Install Hatch
56+ # uses: pypa/ hatch@$hatch- {{ env.HATCH_VERSION }}
5757
5858 # - name: Lint
5959 # run: hatch run lint:check
6969 with :
7070 python-version : ${{ env.PYTHON_VERSION }}
7171
72- - name : Setup Hatch
73- run : pipx install hatch== ${{ env.HATCH_VERSION }}
72+ - name : Install Hatch
73+ uses : pypa/ hatch@hatch- ${{ env.HATCH_VERSION }}
7474
7575 - name : Run Unit Tests
7676 run : hatch run test:ci
@@ -94,38 +94,38 @@ jobs:
9494 build-pypi :
9595 runs-on : ubuntu-24.04
9696 steps :
97- - name : Checkout
98- uses : actions/checkout@v6
99-
100- - name : Setup Python
101- uses : actions/setup-python@v6
102- with :
103- python-version : ${{ env.PYTHON_VERSION }}
104-
105- - name : Setup Hatch
106- run : pipx install hatch== ${{ env.HATCH_VERSION }}
107-
108- # If a version wasn't explicitly passed as a workflow_dispatch input we
109- # default to version v0.0.0+<git-commit-date>-<git-short-sha>, for example
110- # v0.0.0+20231101115142-1091066df799. This is a simple implementation of
111- # Go's pseudo-versions: https://go.dev/ref/mod#pseudo-versions.
112- - name : Set Default PyPI Project Version
113- if : env.PYPI_VERSION == ''
114- run : echo "PYPI_VERSION=v0.0.0+$(date -d@$(git show -s --format=%ct) +%Y%m%d%H%M%S)-$(git rev-parse --short=12 HEAD)" >> $GITHUB_ENV
115-
116- - name : Set PyPI Project Version
117- run : hatch version ${{ env.PYPI_VERSION }}
118-
119- - name : Build Sdist and Wheel
120- run : hatch build
121-
122- - name : Upload Sdist and Wheel to GitHub
123- uses : actions/upload-artifact@v7
124- with :
125- name : dist
126- path : " dist/*"
127- if-no-files-found : error
128- retention-days : 1
97+ - name : Checkout
98+ uses : actions/checkout@v6
99+
100+ - name : Setup Python
101+ uses : actions/setup-python@v6
102+ with :
103+ python-version : ${{ env.PYTHON_VERSION }}
104+
105+ - name : Install Hatch
106+ uses : pypa/ hatch@hatch- ${{ env.HATCH_VERSION }}
107+
108+ # If a version wasn't explicitly passed as a workflow_dispatch input we
109+ # default to version v0.0.0+<git-commit-date>-<git-short-sha>, for example
110+ # v0.0.0+20231101115142-1091066df799. This is a simple implementation of
111+ # Go's pseudo-versions: https://go.dev/ref/mod#pseudo-versions.
112+ - name : Set Default PyPI Project Version
113+ if : env.PYPI_VERSION == ''
114+ run : echo "PYPI_VERSION=v0.0.0+$(date -d@$(git show -s --format=%ct) +%Y%m%d%H%M%S)-$(git rev-parse --short=12 HEAD)" >> $GITHUB_ENV
115+
116+ - name : Set PyPI Project Version
117+ run : hatch version ${{ env.PYPI_VERSION }}
118+
119+ - name : Build Sdist and Wheel
120+ run : hatch build
121+
122+ - name : Upload Sdist and Wheel to GitHub
123+ uses : actions/upload-artifact@v7
124+ with :
125+ name : dist
126+ path : " dist/*"
127+ if-no-files-found : error
128+ retention-days : 1
129129
130130 # We want to build most packages for the amd64 and arm64 architectures. To
131131 # speed this up we build single-platform packages in parallel. We then upload
@@ -142,55 +142,55 @@ jobs:
142142 - amd64
143143 - arm64
144144 steps :
145- - name : Setup QEMU
146- uses : docker/setup-qemu-action@v4
147- with :
148- platforms : all
149-
150- - name : Setup Docker Buildx
151- uses : docker/setup-buildx-action@v4
152- with :
153- version : ${{ env.DOCKER_BUILDX_VERSION }}
154- install : true
155-
156- - name : Checkout
157- uses : actions/checkout@v6
158-
159- - name : Download Wheel from GitHub
160- uses : actions/download-artifact@v8
161- with :
162- name : dist
163- pattern : ' *.whl'
164- path : dist
165-
166- # We ask Docker to use GitHub Action's native caching support to speed up
167- # the build, per https://docs.docker.com/build/cache/backends/gha/.
168- - name : Build Runtime
169- id : image
170- uses : docker/build-push-action@v7
171- with :
172- context : .
173- platforms : linux/${{ matrix.arch }}
174- cache-from : type=gha
175- cache-to : type=gha,mode=max
176- target : image
177- build-args :
178- PYTHON_VERSION=${{ env.PYTHON_VERSION }}
179- outputs : type=docker,dest=runtime-${{ matrix.arch }}.tar
180-
181- - name : Setup the Crossplane CLI
182- run : " mkdir bin && cd bin && curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh"
183-
184- - name : Build Package
185- run : bin/crossplane xpkg build --package-file=${{ matrix.arch }}.xpkg --package-root=package/ --embed-runtime-image-tarball=runtime-${{ matrix.arch }}.tar
186-
187- - name : Upload Single-Platform Package
188- uses : actions/upload-artifact@v7
189- with :
190- name : package-${{ matrix.arch }}
191- path : " *.xpkg"
192- if-no-files-found : error
193- retention-days : 1
145+ - name : Setup QEMU
146+ uses : docker/setup-qemu-action@v4
147+ with :
148+ platforms : all
149+
150+ - name : Setup Docker Buildx
151+ uses : docker/setup-buildx-action@v4
152+ with :
153+ version : ${{ env.DOCKER_BUILDX_VERSION }}
154+ install : true
155+
156+ - name : Checkout
157+ uses : actions/checkout@v6
158+
159+ - name : Download Wheel from GitHub
160+ uses : actions/download-artifact@v8
161+ with :
162+ name : dist
163+ pattern : ' *.whl'
164+ path : dist
165+
166+ # We ask Docker to use GitHub Action's native caching support to speed up
167+ # the build, per https://docs.docker.com/build/cache/backends/gha/.
168+ - name : Build Runtime
169+ id : image
170+ uses : docker/build-push-action@v7
171+ with :
172+ context : .
173+ platforms : linux/${{ matrix.arch }}
174+ cache-from : type=gha
175+ cache-to : type=gha,mode=max
176+ target : image
177+ build-args :
178+ PYTHON_VERSION=${{ env.PYTHON_VERSION }}
179+ outputs : type=docker,dest=runtime-${{ matrix.arch }}.tar
180+
181+ - name : Setup the Crossplane CLI
182+ run : " mkdir bin && cd bin && curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh"
183+
184+ - name : Build Package
185+ run : bin/crossplane xpkg build --package-file=${{ matrix.arch }}.xpkg --package-root=package/ --embed-runtime-image-tarball=runtime-${{ matrix.arch }}.tar
186+
187+ - name : Upload Single-Platform Package
188+ uses : actions/upload-artifact@v7
189+ with :
190+ name : package-${{ matrix.arch }}
191+ path : " *.xpkg"
192+ if-no-files-found : error
193+ retention-days : 1
194194
195195 publish-pypi :
196196 # Don't publish unless we were run with an explicit version.
@@ -199,20 +199,20 @@ jobs:
199199 - build-xpkg # only publish if xpkg builds succeeds
200200 runs-on : ubuntu-24.04
201201 steps :
202- - name : Download Sdist and Wheel from GitHub
203- uses : actions/download-artifact@v8
204- with :
205- name : dist
206- path : dist
202+ - name : Download Sdist and Wheel from GitHub
203+ uses : actions/download-artifact@v8
204+ with :
205+ name : dist
206+ path : dist
207207
208- - name : Setup Hatch
209- run : pipx install hatch== ${{ env.HATCH_VERSION }}
208+ - name : Install Hatch
209+ uses : pypa/ hatch@hatch- ${{ env.HATCH_VERSION }}
210210
211- - name : Publish to PyPI
212- env :
213- HATCH_INDEX_USER : __token__
214- HATCH_INDEX_AUTH : ${{ secrets.PYPI_API_TOKEN }}
215- run : hatch publish --no-prompt
211+ - name : Publish to PyPI
212+ env :
213+ HATCH_INDEX_USER : __token__
214+ HATCH_INDEX_AUTH : ${{ secrets.PYPI_API_TOKEN }}
215+ run : hatch publish --no-prompt
216216
217217 # This job downloads the single-platform packages built by the build job, and
218218 # pushes them as a multi-platform package. We only push the package it the
@@ -227,46 +227,46 @@ jobs:
227227 contents : read
228228 packages : write
229229 steps :
230- - name : Checkout
231- uses : actions/checkout@v6
232-
233- - name : Download Single-Platform Packages
234- uses : actions/download-artifact@v8
235- with :
236- # See https://github.com/docker/build-push-action/blob/263435/README.md#summaries
237- pattern : " !*.dockerbuild"
238- path : .
239- merge-multiple : true
240-
241- - name : Setup the Crossplane CLI
242- run : " mkdir bin && cd bin && curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh"
243-
244- # If a version wasn't explicitly passed as a workflow_dispatch input we
245- # default to version v0.0.0-<git-commit-date>-<git-short-sha>, for example
246- # v0.0.0-20231101115142-1091066df799. This is a simple implementation of
247- # Go's pseudo-versions: https://go.dev/ref/mod#pseudo-versions.
248- - name : Set Default Multi-Platform Package Version
249- if : env.XPKG_VERSION == ''
250- run : echo "XPKG_VERSION=v0.0.0-$(date -d@$(git show -s --format=%ct) +%Y%m%d%H%M%S)-$(git rev-parse --short=12 HEAD)" >> $GITHUB_ENV
251-
252- - name : Login to Upbound
253- uses : docker/login-action@v4
254- if : env.XPKG_ACCESS_ID != ''
255- with :
256- registry : xpkg.upbound.io
257- username : ${{ secrets.XPKG_ACCESS_ID }}
258- password : ${{ secrets.XPKG_TOKEN }}
259-
260- - name : Push Multi-Platform Package to Upbound
261- if : env.XPKG_ACCESS_ID != ''
262- run : " bin/crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.XPKG }}:${{ env.XPKG_VERSION }}"
263-
264- - name : Login to GHCR
265- uses : docker/login-action@v4
266- with :
267- registry : ghcr.io
268- username : ${{ github.repository_owner }}
269- password : ${{ secrets.GITHUB_TOKEN }}
270-
271- - name : Push Multi-Platform Package to GHCR
272- run : " bin/crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.CROSSPLANE_REGORG }}:${{ env.XPKG_VERSION }}"
230+ - name : Checkout
231+ uses : actions/checkout@v6
232+
233+ - name : Download Single-Platform Packages
234+ uses : actions/download-artifact@v8
235+ with :
236+ # See https://github.com/docker/build-push-action/blob/263435/README.md#summaries
237+ pattern : " !*.dockerbuild"
238+ path : .
239+ merge-multiple : true
240+
241+ - name : Setup the Crossplane CLI
242+ run : " mkdir bin && cd bin && curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh"
243+
244+ # If a version wasn't explicitly passed as a workflow_dispatch input we
245+ # default to version v0.0.0-<git-commit-date>-<git-short-sha>, for example
246+ # v0.0.0-20231101115142-1091066df799. This is a simple implementation of
247+ # Go's pseudo-versions: https://go.dev/ref/mod#pseudo-versions.
248+ - name : Set Default Multi-Platform Package Version
249+ if : env.XPKG_VERSION == ''
250+ run : echo "XPKG_VERSION=v0.0.0-$(date -d@$(git show -s --format=%ct) +%Y%m%d%H%M%S)-$(git rev-parse --short=12 HEAD)" >> $GITHUB_ENV
251+
252+ - name : Login to Upbound
253+ uses : docker/login-action@v4
254+ if : env.XPKG_ACCESS_ID != ''
255+ with :
256+ registry : xpkg.upbound.io
257+ username : ${{ secrets.XPKG_ACCESS_ID }}
258+ password : ${{ secrets.XPKG_TOKEN }}
259+
260+ - name : Push Multi-Platform Package to Upbound
261+ if : env.XPKG_ACCESS_ID != ''
262+ run : " bin/crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.XPKG }}:${{ env.XPKG_VERSION }}"
263+
264+ - name : Login to GHCR
265+ uses : docker/login-action@v4
266+ with :
267+ registry : ghcr.io
268+ username : ${{ github.repository_owner }}
269+ password : ${{ secrets.GITHUB_TOKEN }}
270+
271+ - name : Push Multi-Platform Package to GHCR
272+ run : " bin/crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.CROSSPLANE_REGORG }}:${{ env.XPKG_VERSION }}"
0 commit comments