Skip to content

Commit

Permalink
Merge pull request #132 from upbound/feature/push-spaces-artifacts
Browse files Browse the repository at this point in the history
feat(spaces-artifacts): add option to push in parallel image to spacess-artifacts
  • Loading branch information
turkenh authored Sep 12, 2024
2 parents 194ff52 + 5dde8ac commit e28f9fd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ env:
# credentials have been provided before trying to run steps that need them.
DOCKER_USR: ${{ secrets.DOCKER_USR }}
UPBOUND_MARKETPLACE_PUSH_ROBOT_USR: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }}
XPKG_ACCESS_ID: ${{ secrets.XPKG_ACCESS_ID }}

jobs:
check-diff:
Expand Down Expand Up @@ -397,10 +398,18 @@ jobs:
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
if: env.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR != ''
with:
registry: xpkg.upbound.io
registry: xpkg.upbound.io/upbound
username: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }}
password: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW }}

- name: Login to Spaces Artifacts Registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
if: env.XPKG_ACCESS_ID != ''
with:
registry: xpkg.upbound.io/spaces-artifacts
username: ${{ secrets.XPKG_ACCESS_ID }}
password: ${{ secrets.XPKG_TOKEN }}

- name: Publish Artifacts to Marketplace, DockerHub
run: make -j2 publish BRANCH_NAME=${GITHUB_REF##*/}

Expand Down Expand Up @@ -453,7 +462,7 @@ jobs:

- name: Setup Buf
uses: bufbuild/buf-setup-action@v1

- name: Lint Protocol Buffers
uses: bufbuild/buf-lint-action@v1
with:
Expand All @@ -474,7 +483,7 @@ jobs:
with:
input: apis
against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=${GITHUB_REF_NAME},subdir=apis"

- name: Push Protocol Buffers to Buf Schema Registry
if: ${{ github.repository == 'crossplane/crossplane' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-')) }}
uses: bufbuild/buf-push-action@v1
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/promote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ env:
# a step 'if env.AWS_USR' != ""', so we copy these to succinctly test whether
# credentials have been provided before trying to run steps that need them.
DOCKER_USR: ${{ secrets.DOCKER_USR }}
UPBOUND_MARKETPLACE_PUSH_ROBOT_USR: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }}
XPKG_ACCESS_ID: ${{ secrets.XPKG_ACCESS_ID }}

jobs:
promote-artifacts:
Expand Down Expand Up @@ -57,10 +59,18 @@ jobs:
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
if: env.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR != ''
with:
registry: xpkg.upbound.io
registry: xpkg.upbound.io/upbound
username: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }}
password: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW }}

- name: Login to Spaces Artifacts Registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
if: env.XPKG_ACCESS_ID != ''
with:
registry: xpkg.upbound.io/spaces-artifacts
username: ${{ secrets.XPKG_ACCESS_ID }}
password: ${{ secrets.XPKG_TOKEN }}

- name: Promote Artifacts in DockerHub and Upbound Registry
if: env.DOCKER_USR != '' && env.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR != ''
run: make -j2 promote BRANCH_NAME=${GITHUB_REF##*/}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ KIND_VERSION = v0.21.0
# Due to the way that the shared build logic works, images should
# all be in folders at the same level (no additional levels of nesting).

REGISTRY_ORGS ?= docker.io/upbound xpkg.upbound.io/upbound
REGISTRY_ORGS ?= docker.io/upbound xpkg.upbound.io/upbound xpkg.upbound.io/spaces-artifacts
IMAGES = crossplane
-include build/makelib/imagelight.mk

Expand Down

0 comments on commit e28f9fd

Please sign in to comment.