Skip to content

Commit

Permalink
No need to promote images to master in CI workflow
Browse files Browse the repository at this point in the history
Earthly will just push the tags.

Signed-off-by: Nic Cope <nicc@rk0n.org>
  • Loading branch information
negz committed May 25, 2024
1 parent 655c55d commit 8599220
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,22 +257,6 @@ jobs:
- name: Build and Push Artifacts
run: earthly --strict +ci-artifacts --CROSSPLANE_VERSION=${CROSSPLANE_VERSION}

- name: Promote Image to docker.io/crossplane/crossplane:master
if: env.DOCKER_USR != '' && github.ref == 'refs/heads/master'
run: |
earthly --strict \
--secret DOCKER_USER=${{ secrets.DOCKER_USR }} \
--secret DOCKER_PASSWORD=${{ secrets.DOCKER_PSW }} \
+ci-promote-image --CHANNEL=master --CROSSPLANE_VERSION=${CROSSPLANE_VERSION} --CROSSPLANE_REPO=docker.io/crossplane/crossplane
- name: Promote Image to xpkg.upbound.io/crossplane/crossplane:master
if: env.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR != '' && github.ref == 'refs/heads/master'
run: |
earthly --strict \
--secret DOCKER_USER=${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }} \
--secret DOCKER_PASSWORD=${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW }} \
+ci-promote-image --CHANNEL=master --CROSSPLANE_VERSION=${CROSSPLANE_VERSION} --CROSSPLANE_REPO=xpkg.upbound.io/crossplane/crossplane
- name: Push Artifacts to https://releases.crossplane.io/build/
if: env.AWS_USR != ''
run: earthly --strict +ci-push-build-artifacts --CROSSPLANE_VERSION=${CROSSPLANE_VERSION}
Expand Down
11 changes: 9 additions & 2 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ image:
EXPOSE 8080
USER 65532
ENTRYPOINT ["crossplane"]
SAVE IMAGE ${CROSSPLANE_REPO}:${CROSSPLANE_VERSION}
SAVE IMAGE ${CROSSPLANE_REPO}:${EARTHLY_GIT_BRANCH}
SAVE IMAGE --push ${CROSSPLANE_REPO}:${CROSSPLANE_VERSION}
SAVE IMAGE --push ${CROSSPLANE_REPO}:${EARTHLY_GIT_BRANCH}

# multiplatform-image builds the Crossplane OCI image for all supported
# architectures.
Expand Down Expand Up @@ -351,6 +351,13 @@ ci-promote-image:
--tag ${CROSSPLANE_REPO}:${CROSSPLANE_VERSION}-${CHANNEL} \
${CROSSPLANE_REPO}:${CROSSPLANE_VERSION}

# TODO(negz): Ideally ci-push-build-artifacts would be merged into ci-artifacts,
# i.e. just build and push them all in the same target. Currently we're relying
# on the fact that ci-artifacts does a bunch of SAVE ARTIFACT AS LOCAL, which
# ci-push-build-artifacts then loads. That's an anti-pattern in Earthly. We're
# supposed to use COPY instead, but I'm not sure how to COPY artifacts from a
# matrix build.

# ci-push-build-artifacts is used by CI to push binary artifacts to S3.
ci-push-build-artifacts:
ARG --required CROSSPLANE_VERSION
Expand Down

0 comments on commit 8599220

Please sign in to comment.