Skip to content

Commit

Permalink
Update default branch in CI and fix pushing to marketplace
Browse files Browse the repository at this point in the history
Signed-off-by: Hasan Turken <[email protected]>
  • Loading branch information
turkenh committed Sep 12, 2024
1 parent e28f9fd commit c410433
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
37 changes: 25 additions & 12 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 Down Expand Up @@ -402,6 +402,16 @@ jobs:
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/main' && env.DOCKER_USR != ''
run: make -j2 promote
env:
BRANCH_NAME: main
CHANNEL: main

- name: Login to Spaces Artifacts Registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
if: env.XPKG_ACCESS_ID != ''
Expand All @@ -410,15 +420,18 @@ jobs:
username: ${{ secrets.XPKG_ACCESS_ID }}
password: ${{ secrets.XPKG_TOKEN }}

- name: Publish Artifacts to Marketplace, DockerHub
- 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 DockerHub
if: github.ref == 'refs/heads/master' && env.DOCKER_USR != ''
- name: Promote Artifacts in Spaces Artifacts Registry
if: github.ref == 'refs/heads/main' && env.DOCKER_USR != ''
run: make -j2 promote
env:
BRANCH_NAME: master
CHANNEL: master
REGISTRY_ORGS: xpkg.upbound.io/spaces-artifacts
BRANCH_NAME: main
CHANNEL: main

fuzz-test:
runs-on: ubuntu-22.04
Expand All @@ -430,13 +443,13 @@ jobs:
# seems to build Crossplane inside of a Docker image.
- name: Build Fuzzers
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@main
with:
oss-fuzz-project-name: "crossplane"
language: go

- name: Run Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@main
with:
oss-fuzz-project-name: "crossplane"
fuzz-seconds: 300
Expand Down Expand Up @@ -468,13 +481,13 @@ jobs:
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 @@ -485,7 +498,7 @@ jobs:
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
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 xpkg.upbound.io/spaces-artifacts
REGISTRY_ORGS ?= docker.io/upbound xpkg.upbound.io/upbound
IMAGES = crossplane
-include build/makelib/imagelight.mk

Expand Down

0 comments on commit c410433

Please sign in to comment.