Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 14 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,18 @@ env:
# Common versions
PYTHON_VERSION: '3.11'
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
# script. They determine what version it installs.
XP_CHANNEL: master # TODO(negz): Pin to stable once v1.14 is released.
XP_VERSION: current # TODO(negz): Pin to a version once v1.14 is released.

# 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 }}
XP_CHANNEL: stable
XP_VERSION: v1.20.0

# The package to push, without a version tag. The default matches GitHub. For
# example xpkg.upbound.io/crossplane/function-template-go.
XPKG: xpkg.upbound.io/${{ github.repository}}
# example xpkg.crossplane.io/crossplane/function-template-go. Note that
# 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.
XPKG_VERSION: ${{ inputs.version }}
Expand Down Expand Up @@ -127,8 +124,7 @@ jobs:
retention-days: 1

# 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
# XPKG_ACCESS_ID and XPKG_TOKEN secrets were provided.
# pushes them as a multi-platform package.
push:
runs-on: ubuntu-24.04
needs:
Expand All @@ -140,19 +136,20 @@ jobs:
- name: Download Single-Platform Packages
uses: actions/download-artifact@v4
with:
# See https://github.com/docker/build-push-action/blob/263435/README.md#summaries
pattern: "!*.dockerbuild"
path: .
merge-multiple: true

- name: Setup the Crossplane CLI
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
if: env.XPKG_ACCESS_ID != ''
with:
registry: xpkg.upbound.io
username: ${{ secrets.XPKG_ACCESS_ID }}
password: ${{ secrets.XPKG_TOKEN }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

# 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
Expand All @@ -162,6 +159,5 @@ jobs:
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

- name: Push Multi-Platform Package to Upbound
if: env.XPKG_ACCESS_ID != ''
- name: Push Multi-Platform Package to GitHub Container Registry
run: "./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.XPKG }}:${{ env.XPKG_VERSION }}"
Loading