From 8ed5691ee052adef6f8f133b69da91110f53309c Mon Sep 17 00:00:00 2001 From: Nic Cope Date: Sun, 22 Oct 2023 16:02:15 -0700 Subject: [PATCH] Push a multi-platform package Signed-off-by: Nic Cope --- .github/workflows/ci.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ffb76c..62d4ada 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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 != '' @@ -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 ... \ No newline at end of file + run: "./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.PACKAGE }}" \ No newline at end of file