2222 XP_CHANNEL : master # TODO(negz): Pin to stable once v1.14 is released.
2323 XP_VERSION : current # TODO(negz): Pin to a version once v1.14 is released.
2424
25- # The package to push to GHCR
25+ # The package to push to GHCR and upbound.io
26+ XPKG : xpkg.upbound.io/${{ github.repository}}
2627 CROSSPLANE_REGORG : ghcr.io/${{ github.repository}}
2728
2829 # The package version to push. The default is 0.0.0-gitsha.
6667 # We want to build most packages for the amd64 and arm64 architectures. To
6768 # speed this up we build single-platform packages in parallel. We then upload
6869 # those packages to GitHub as a build artifact. The push job downloads those
69- # artifacts and pushes them as a single multi-platform package.
70+ # artifacts and pushes them as a single multi-platform package.
7071 build :
7172 runs-on : ubuntu-24.04
7273 strategy :
@@ -104,13 +105,13 @@ jobs:
104105 build-args :
105106 PYTHON_VERSION=${{ env.PYTHON_VERSION }}
106107 outputs : type=docker,dest=runtime-${{ matrix.arch }}.tar
107-
108+
108109 - name : Setup the Crossplane CLI
109110 run : " curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh"
110111
111112 - name : Build Package
112113 run : ./crossplane xpkg build --package-file=${{ matrix.arch }}.xpkg --package-root=package/ --embed-runtime-image-tarball=runtime-${{ matrix.arch }}.tar
113-
114+
114115 - name : Upload Single-Platform Package
115116 uses : actions/upload-artifact@v6
116117 with :
@@ -133,14 +134,21 @@ jobs:
133134 - name : Download Single-Platform Packages
134135 uses : actions/download-artifact@v7
135136 with :
136- # See https://github.com/docker/build-push-action/blob/263435/README.md#summaries
137- pattern : " !*.dockerbuild"
138137 path : .
139138 merge-multiple : true
139+ pattern : " !*.dockerbuild" # This gets uploaded by docker/build-push-action but must be skipped: https://github.com/actions/toolkit/pull/1874
140140
141141 - name : Setup the Crossplane CLI
142142 run : " curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh"
143143
144+ - name : Login to Upbound
145+ uses : docker/login-action@v3
146+ if : env.XPKG_ACCESS_ID != ''
147+ with :
148+ registry : xpkg.upbound.io
149+ username : ${{ secrets.XPKG_ACCESS_ID }}
150+ password : ${{ secrets.XPKG_TOKEN }}
151+
144152 # If a version wasn't explicitly passed as a workflow_dispatch input we
145153 # default to version v0.0.0-<git-commit-date>-<git-short-sha>, for example
146154 # v0.0.0-20231101115142-1091066df799. This is a simple implementation of
@@ -149,6 +157,10 @@ jobs:
149157 if : env.XPKG_VERSION == ''
150158 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
151159
160+ - name : Push Multi-Platform Package to Upbound
161+ if : env.XPKG_ACCESS_ID != ''
162+ run : " ./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.XPKG }}:${{ env.XPKG_VERSION }}"
163+
152164 - name : Login to GHCR
153165 uses : docker/login-action@v3
154166 with :
0 commit comments