Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-1.15] feat(spaces-artifacts): add option to push in parallel image to spaces-artifacts #135

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 33 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on:
push:
branches:
- master
- main
- release-*
pull_request: {}
workflow_dispatch: {}
Expand All @@ -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,19 +398,40 @@ 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: Publish Artifacts to Marketplace, DockerHub
run: make -j2 publish BRANCH_NAME=${GITHUB_REF##*/}

- name: Promote Artifacts in DockerHub
if: github.ref == 'refs/heads/master' && env.DOCKER_USR != ''
if: github.ref == 'refs/heads/main' && env.DOCKER_USR != ''
run: make -j2 promote
env:
BRANCH_NAME: master
CHANNEL: master
BRANCH_NAME: main
CHANNEL: main

- 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 Spaces Artifacts Registry
run: make -j2 publish BRANCH_NAME=${GITHUB_REF##*/}
env:
REGISTRY_ORGS: xpkg.upbound.io/spaces-artifacts

- name: Promote Artifacts in Spaces Artifacts Registry
if: github.ref == 'refs/heads/main' && env.DOCKER_USR != ''
run: make -j2 promote
env:
REGISTRY_ORGS: xpkg.upbound.io/spaces-artifacts
BRANCH_NAME: main
CHANNEL: main

fuzz-test:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -453,19 +475,19 @@ jobs:

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

- name: Lint Protocol Buffers
uses: bufbuild/buf-lint-action@v1
with:
input: apis

- name: Detect Breaking Changes in Protocol Buffers (Master Branch)
- name: Detect Breaking Changes in Protocol Buffers (Main Branch)
uses: bufbuild/buf-breaking-action@a074e988ee34efcd4927079e79c611f428354c01 # v1
# We want to run this for the master branch, and PRs.
# We want to run this for the main branch, and PRs.
if: ${{ ! startsWith(github.ref, 'refs/heads/release-') }}
with:
input: apis
against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=master,subdir=apis"
against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=main,subdir=apis"

- name: Detect Breaking Changes in Protocol Buffers (Release Branch)
uses: bufbuild/buf-breaking-action@a074e988ee34efcd4927079e79c611f428354c01 # v1
Expand All @@ -474,9 +496,9 @@ 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-')) }}
if: ${{ github.repository == 'crossplane/crossplane' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-')) }}
uses: bufbuild/buf-push-action@v1
with:
input: apis
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
Loading