Skip to content

ai_toolkit_workflow #66

ai_toolkit_workflow

ai_toolkit_workflow #66

name: ai_toolkit_workflow
on:
workflow_dispatch:
inputs:
version:
description: 'The version number of the operator'
required: true
default: '0.0.1'
branch:
description: 'Branch to run the workflow on'
required: true
default: 'feature/github_actions'
env:
GH_TOKEN: ${{ github.token }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v3
- name: running make commands
run: make generate manifests
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
platforms: linux/s390x
- name: Log in to QUAY
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.CR_USER_NAME }}
password: ${{ secrets.CR_SECRET }}
- name: Docker build and push using dockerbuildx
run: |
export IMG=quay.io/openshift-ai-toolkit/openshift-ai-toolkit-operator-controller-test
export PLATFORMS=linux/s390x
make docker-buildx
- name: Bundle build and push
run: |
export BUNDLE_IMG="quay.io/openshift-ai-toolkit/openshift-ai-toolkit-operator-bundle-test:v${{ github.event.inputs.VERSION }}"
echo $BUNDLE_IMG
make bundle-build bundle-push
- name: Catalog build and push
run: |
export BUNDLE_IMG="quay.io/openshift-ai-toolkit/openshift-ai-toolkit-operator-bundle-test:v${{ github.event.inputs.VERSION }}"
export CATALOG_IMG=quay.io/openshift-ai-toolkit/openshift-ai-toolkit-operator-catalog-test:v${{ github.event.inputs.VERSION }}
make catalog-build catalog-push
docker save -o catalogManual.tar quay.io/openshift-ai-toolkit/openshift-ai-toolkit-operator-catalog-test:v${{ github.event.inputs.VERSION }}
- name: Create a release and upload build assets
uses: softprops/action-gh-release@v1
with:
files: catalogManual.tar
tag_name: v${{ github.event.inputs.VERSION }}
#docker save -o catalogBuild.tar quay.io/openshift-ai-toolkit/openshift-ai-toolkit-operator-catalog-test:latest
# docker images
# - name: Create GitHub Release
# id: create_release
# uses: softprops/action-gh-release@v1
# with:
# files: catalogBuild.tar
# tag_name: latest # Use the tag name
# release_name: Release latest
# - name: Get short SHA
# id: vars
# run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
# - name: Create GitHub Release with sha
# id: create_release_sha
# uses: softprops/action-gh-release@v1
# with:
# files: catalogBuild.tar
# tag_name: ${{ env.SHORT_SHA }} # Use the tag name
# release_name: Release ${{ env.SHORT_SHA }}
# echo $(git tag -l) >> existingTags
# cat existingTags
# if grep -q "latest" existingTags; then
# echo "Tag exists"
# gh release upload latest catalogbuild.tar --clobber
# else
# echo "Tag doesnt exists"
# echo $(grep -q "latest" existingTags)
# gh release create latest catalogbuild.tar --notes "tagging and releasing the build binary"
# fi
# if grep -q "${{ env.SHORT_SHA }}" existingTags; then
# echo "Tag exists"
# gh release upload ${{ env.SHORT_SHA }} catalogbuild.tar --clobber
# else
# echo "Tag doesnt exists"
# gh release create ${{ env.SHORT_SHA }} catalogbuild.tar --notes "tagging and releasing the build binary"
# fi