Skip to content

CARRY: Update go build to v1.21 #20

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

Closed
wants to merge 9 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
12 changes: 0 additions & 12 deletions .github/resources-olm-upgrade/catalogsource.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions .github/resources-olm-upgrade/operatorgroup.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/resources-olm-upgrade/subscription.yaml

This file was deleted.

75 changes: 75 additions & 0 deletions .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# This workflow will build the CodeFlare Operator image and push it to the opendatahub image registry

name: Build and Push

on:
push:
branches:
- 'main'
paths:
- 'config/manager/params.env'
workflow_dispatch:

jobs:
check-image-existence:
name: Check if ODH CFO image exists on Quay
runs-on: ubuntu-latest
outputs:
image-found: ${{ steps.image.outputs.found }}
steps:
- uses: actions/checkout@v4

- name: Verify that the latest images are available on Quay
id: image
run: |
imageTag=$(cat config/manager/params.env | grep codeflare-operator-controller-image | cut -d ':' -f2)
size=$(curl -s https://quay.io/api/v1/repository/opendatahub/codeflare-operator/tag/?specificTag=$imageTag | jq .tags[0].size)
if [[ "$size" -eq 0 ]]; then
echo "Operator image with tag $imageTag not found in Quay.io, will be built."
echo "found=false" >> "$GITHUB_OUTPUT"
else
echo "Operator image with tag $imageTag found in Quay.io"
fi

build-and-push:
needs: [check-image-existence]
if: ${{ needs.check-image-existence.outputs.image-found == 'false' }}

name: Build and push ODH/CFO image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set Go
uses: actions/setup-go@v5
with:
go-version-file: './go.mod'

- name: Login to Quay.io
uses: redhat-actions/podman-login@v1
with:
username: ${{ secrets.QUAY_BOT_USER }}
password: ${{ secrets.QUAY_BOT_PASSWORD }}
registry: quay.io

- name: Get Upstream Release Tags
id: release-tags
run: |
release_tag=$(gh release view -R github.com/project-codeflare/codeflare-operator --json tagName | jq -r '.tagName')
echo "RELEASE_TAG=$release_tag" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Cleanup the go.mod and go.sum
run: |
go mod tidy

- name: Image Build and Push
run: |
make build
make image-build -e IMG=quay.io/opendatahub/codeflare-operator:${{ env.RELEASE_TAG }}
make image-push -e IMG=quay.io/opendatahub/codeflare-operator:${{ env.RELEASE_TAG }}

- name: Delete remote branch
run: |
git push origin --delete sync-cfo-fork
117 changes: 0 additions & 117 deletions .github/workflows/e2e_tests.yaml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/odh-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This workflow will compile e2e tests and release them

name: ODH Release
on:
workflow_dispatch:
inputs:
version:
description: 'Tag to be used for release, i.e.: v0.0.1'
required: true

jobs:
release-odh:
runs-on: ubuntu-latest

# Permission required to create a release
permissions:
contents: write

steps:
- uses: actions/checkout@v4

- name: Set Go
uses: actions/setup-go@v5
with:
go-version: v1.20

- name: Verify that release doesn't exist yet
shell: bash {0}
run: |
gh release view ${{ github.event.inputs.version }}
status=$?
if [[ $status -eq 0 ]]; then
echo "Release ${{ github.event.inputs.version }} already exists."
exit 1
fi
env:
GITHUB_TOKEN: ${{ github.TOKEN }}

- name: Compile tests
run: |
go test -c -o compiled-tests/e2e ./test/e2e/
go test -c -o compiled-tests/odh ./test/odh/

- name: Creates a release in GitHub
run: |
gh release create ${{ github.event.inputs.version }} --target ${{ github.ref }} compiled-tests/*
env:
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
shell: bash
Loading