Skip to content

Commit

Permalink
Build an xpkg
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 0d793c1 commit 9c4f60d
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
# Common versions
GO_VERSION: '1.21.3'
GOLANGCI_VERSION: 'v1.54.2'
DOCKER_BUILDX_VERSION: 'v0.10.0'
DOCKER_BUILDX_VERSION: 'v0.11.2'

# 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
Expand Down Expand Up @@ -78,7 +78,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Build Function Runtime
- name: Build Runtime
id: image
uses: docker/build-push-action@v5
with:
context: .
Expand All @@ -89,9 +90,21 @@ jobs:
build-args:
GO_VERSION=${{ env.GO_VERSION }}
load: true
tags: function/runtime:${{ github.sha }}

# TODO(negz): Use the crossplane-contrib/xpkg-action for this? It doesn't
# currently do anything other than download the CLI and run a command.
- 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

# TODO(negz): We must pass index.docker.io explicitly until
# https://github.com/crossplane/crossplane/pull/4867 is fixed.
- name: Build Package
run: ./crossplane xpkg build --package-root=package/ --embed-runtime-image=index.docker.io/function/runtime:${{ github.sha }}

# TODO(negz): Build Function package using Crossplane CLI.

- name: Login to Upbound
uses: docker/login-action@v3
if: env.XPKG_PUSH_ROBOT_USR != ''
Expand Down

0 comments on commit 9c4f60d

Please sign in to comment.