Skip to content

Commit

Permalink
Push a multi-platform package
Browse files Browse the repository at this point in the history
Signed-off-by: Nic Cope <[email protected]>
  • Loading branch information
negz committed Oct 22, 2023
1 parent 47cd7f9 commit 8ed5691
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ env:
GO_VERSION: '1.21.3'
GOLANGCI_VERSION: 'v1.54.2'
DOCKER_BUILDX_VERSION: 'v0.11.2'
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.

# Common users. We can't run a step 'if secrets.AWS_USR != ""' but we can run
# a step 'if env.AWS_USR' != ""', so we copy these to succinctly test whether
# Common users. We can't run a step 'if secrets.USR != ""' but we can run
# a step 'if env.USR' != ""', so we copy these to succinctly test whether
# credentials have been provided before trying to run steps that need them.
XPKG_PUSH_ROBOT_USR: ${{ secrets.XPKG_PUSH_ROBOT_USR }}

# The package to push.
PACKAGE: xpkg.upbound.io/${{ github.repository_owner}}/${{ github.repository}}:v0.0.0-${{ github.sha }}

jobs:
lint:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -89,14 +94,11 @@ jobs:

- name: Setup the Crossplane CLI
run: "curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh"
env:
XP_CHANNEL: master
XP_VERSION: current

- name: Build Package
run: ./crossplane xpkg build --package-file=${{ matrix.arch }}.xpkg --package-root=package/ --embed-runtime-image-tarball=runtime.tar

- name: Upload Package
- name: Upload Single-Platform Package
uses: actions/upload-artifact@v3
with:
name: packages
Expand All @@ -109,12 +111,15 @@ jobs:
needs:
- build
steps:
- name: Download Single-Architecture Packages
- name: Download Single-Platform Packages
uses: actions/download-artifact@v3
with:
name: packages
path: .

- name: Setup the Crossplane CLI
run: "curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh"

- name: Login to Upbound
uses: docker/login-action@v3
if: env.XPKG_PUSH_ROBOT_USR != ''
Expand All @@ -123,8 +128,7 @@ jobs:
username: ${{ secrets.XPKG_PUSH_ROBOT_USR }}
password: ${{ secrets.XPKG_PUSH_ROBOT_PSW }}

- name: Push Multi-Architecture Package to Upbound

- name: Push Multi-Platform Package to Upbound
if: env.XPKG_PUSH_ROBOT_USR != ''
# TODO(negz): We need to support pushing multiple packages to create a
# multi-arch package.
run: ./crossplane xpkg push ...
run: "./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.PACKAGE }}"

0 comments on commit 8ed5691

Please sign in to comment.