Merge pull request #126 from negz/cee-eye

Fix CI builds, and push to `xpkg.crossplane.io` instead of `xpkg.upbound.io`
This commit is contained in:
Nic Cope 2025-06-06 14:49:23 -07:00 committed by GitHub
commit 1e53790dbd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 18 deletions

View File

@ -16,21 +16,18 @@ env:
# Common versions # Common versions
PYTHON_VERSION: '3.11' PYTHON_VERSION: '3.11'
HATCH_VERSION: '1.12.0' HATCH_VERSION: '1.12.0'
DOCKER_BUILDX_VERSION: 'v0.11.2' DOCKER_BUILDX_VERSION: 'v0.24.0'
# These environment variables are important to the Crossplane CLI install.sh # These environment variables are important to the Crossplane CLI install.sh
# script. They determine what version it installs. # script. They determine what version it installs.
XP_CHANNEL: master # TODO(negz): Pin to stable once v1.14 is released. XP_CHANNEL: stable
XP_VERSION: current # TODO(negz): Pin to a version once v1.14 is released. XP_VERSION: v1.20.0
# This CI job will automatically push new builds to xpkg.upbound.io if the
# XPKG_ACCESS_ID and XPKG_TOKEN secrets are set in the GitHub respository (or
# organization) settings. Create a token at https://accounts.upbound.io.
XPKG_ACCESS_ID: ${{ secrets.XPKG_ACCESS_ID }}
# The package to push, without a version tag. The default matches GitHub. For # The package to push, without a version tag. The default matches GitHub. For
# example xpkg.upbound.io/crossplane/function-template-go. # example xpkg.crossplane.io/crossplane/function-template-go. Note that
XPKG: xpkg.upbound.io/${{ github.repository}} # xpkg.crossplane.io is just an alias for ghcr.io, so we upload to ghcr.io but
# this'll be pulled from xpkg.crossplane.io.
XPKG: ghcr.io/${{ github.repository}}
# The package version to push. The default is 0.0.0-gitsha. # The package version to push. The default is 0.0.0-gitsha.
XPKG_VERSION: ${{ inputs.version }} XPKG_VERSION: ${{ inputs.version }}
@ -127,8 +124,7 @@ jobs:
retention-days: 1 retention-days: 1
# This job downloads the single-platform packages built by the build job, and # This job downloads the single-platform packages built by the build job, and
# pushes them as a multi-platform package. We only push the package it the # pushes them as a multi-platform package.
# XPKG_ACCESS_ID and XPKG_TOKEN secrets were provided.
push: push:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
needs: needs:
@ -140,19 +136,20 @@ jobs:
- name: Download Single-Platform Packages - name: Download Single-Platform Packages
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
# See https://github.com/docker/build-push-action/blob/263435/README.md#summaries
pattern: "!*.dockerbuild"
path: . path: .
merge-multiple: true merge-multiple: true
- name: Setup the Crossplane CLI - name: Setup the Crossplane CLI
run: "curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh" run: "curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh"
- name: Login to Upbound - name: Login to GitHub Container Registry
uses: docker/login-action@v3 uses: docker/login-action@v3
if: env.XPKG_ACCESS_ID != ''
with: with:
registry: xpkg.upbound.io registry: xpkg.upbound.io
username: ${{ secrets.XPKG_ACCESS_ID }} username: ${{ github.repository_owner }}
password: ${{ secrets.XPKG_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
# If a version wasn't explicitly passed as a workflow_dispatch input we # If a version wasn't explicitly passed as a workflow_dispatch input we
# default to version v0.0.0-<git-commit-date>-<git-short-sha>, for example # default to version v0.0.0-<git-commit-date>-<git-short-sha>, for example
@ -162,6 +159,5 @@ jobs:
if: env.XPKG_VERSION == '' if: env.XPKG_VERSION == ''
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 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
- name: Push Multi-Platform Package to Upbound - name: Push Multi-Platform Package to GitHub Container Registry
if: env.XPKG_ACCESS_ID != ''
run: "./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.XPKG }}:${{ env.XPKG_VERSION }}" run: "./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.XPKG }}:${{ env.XPKG_VERSION }}"