-
Notifications
You must be signed in to change notification settings - Fork 1
126 lines (91 loc) · 4.15 KB
/
ai_toolkit_workflow.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
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: check opm version
run: opm --version
- name: Docker build and push using dockerbuildx
run: |
docker build --platform linux/s390x -t quay.io/openshift-ai-toolkit/openshift-ai-toolkit-operator-controller-test:latest .
docker push quay.io/openshift-ai-toolkit/openshift-ai-toolkit-operator-controller-test:latest
- 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 }}
# $(OPM) index add --container-tool docker --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) $(FROM_INDEX_OPT)
#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