Skip to content

Commit 6b4274d

Browse files
committed
Adjust Makefile versions before building operator image
1 parent 598f32b commit 6b4274d

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

Diff for: .github/workflows/tag-and-build.yml

+19-17
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ jobs:
4949
permissions:
5050
contents: write
5151

52+
env:
53+
IMAGE_ORG_BASE: quay.io/${{ github.event.inputs.quay-organization }}
54+
5255
steps:
5356
- uses: actions/checkout@v3
5457

@@ -73,6 +76,20 @@ jobs:
7376
- name: Install operator-sdk
7477
run: make install-operator-sdk
7578

79+
- name: Adjust Compatibility Matrix in readme
80+
run: |
81+
sed -i -E "s/(.*CodeFlare Operator.*)v[0-9]+\.[0-9]+\.[0-9]+(.*)/\1${{ github.event.inputs.version }}\2/" README.md
82+
sed -i -E "s/(.*Multi-Cluster App Dispatcher.*)v[0-9]+\.[0-9]+\.[0-9]+(.*)/\1${{ github.event.inputs.mcad-version }}\2/" README.md
83+
sed -i -E "s/(.*CodeFlare-SDK.*)v[0-9]+\.[0-9]+\.[0-9]+(.*)/\1${{ github.event.inputs.codeflare-sdk-version }}\2/" README.md
84+
sed -i -E "s/(.*InstaScale.*)v[0-9]+\.[0-9]+\.[0-9]+(.*)/\1${{ github.event.inputs.instascale-version }}\2/" README.md
85+
86+
- name: Adjust MCAD and InstaScale dependencies in the code
87+
run: |
88+
sed -i -E "s/(.*MCAD_VERSION \?= )v[0-9]+\.[0-9]+\.[0-9]+(.*)/\1${{ github.event.inputs.mcad-version }}\2/" Makefile
89+
sed -i -E "s/(.*INSTASCALE_VERSION \?= )v[0-9]+\.[0-9]+\.[0-9]+(.*)/\1${{ github.event.inputs.instascale-version }}\2/" Makefile
90+
sed -i -E "s/(.*instascale-controller:)v[0-9]+\.[0-9]+\.[0-9]+(.*)/\1${{ github.event.inputs.instascale-version }}\2/" controllers/testdata/instascale_test_results/case_1/deployment.yaml
91+
sed -i -E "s/(.*instascale-controller:)v[0-9]+\.[0-9]+\.[0-9]+(.*)/\1${{ github.event.inputs.instascale-version }}\2/" controllers/testdata/instascale_test_results/case_2/deployment.yaml
92+
7693
- name: Login to Quay.io
7794
uses: redhat-actions/podman-login@v1
7895
with:
@@ -103,29 +120,14 @@ jobs:
103120
INSTASCALE_VERSION: ${{ github.event.inputs.instascale-version }}
104121
MCAD_VERSION: ${{ github.event.inputs.mcad-version }}
105122
GH_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
106-
IMAGE_ORG_BASE: quay.io/${{ github.event.inputs.quay-organization }}
107123
OPERATORS_REPO_FORK_ORG: ${{ github.event.inputs.community-operators-prod-fork-organization }}
108124
OPERATORS_REPO_ORG: ${{ github.event.inputs.community-operators-prod-organization }}
109125

110-
- name: Adjust Compatibility Matrix in readme
111-
run: |
112-
sed -i -E "s/(.*CodeFlare Operator.*)v[0-9]+\.[0-9]+\.[0-9]+(.*)/\1${{ github.event.inputs.version }}\2/" README.md
113-
sed -i -E "s/(.*Multi-Cluster App Dispatcher.*)v[0-9]+\.[0-9]+\.[0-9]+(.*)/\1${{ github.event.inputs.mcad-version }}\2/" README.md
114-
sed -i -E "s/(.*CodeFlare-SDK.*)v[0-9]+\.[0-9]+\.[0-9]+(.*)/\1${{ github.event.inputs.codeflare-sdk-version }}\2/" README.md
115-
sed -i -E "s/(.*InstaScale.*)v[0-9]+\.[0-9]+\.[0-9]+(.*)/\1${{ github.event.inputs.instascale-version }}\2/" README.md
116-
117-
- name: Adjust MCAD and InstaScale dependencies in the code
118-
run: |
119-
sed -i -E "s/(.*MCAD_VERSION \?= )v[0-9]+\.[0-9]+\.[0-9]+(.*)/\1${{ github.event.inputs.mcad-version }}\2/" Makefile
120-
sed -i -E "s/(.*INSTASCALE_VERSION \?= )v[0-9]+\.[0-9]+\.[0-9]+(.*)/\1${{ github.event.inputs.instascale-version }}\2/" Makefile
121-
sed -i -E "s/(.*instascale-controller:)v[0-9]+\.[0-9]+\.[0-9]+(.*)/\1${{ github.event.inputs.instascale-version }}\2/" controllers/testdata/instascale_test_results/case_1/deployment.yaml
122-
sed -i -E "s/(.*instascale-controller:)v[0-9]+\.[0-9]+\.[0-9]+(.*)/\1${{ github.event.inputs.instascale-version }}\2/" controllers/testdata/instascale_test_results/case_2/deployment.yaml
123-
124-
- name: Commit readme changes back to repository
126+
- name: Commit changes in the code back to repository
125127
uses: stefanzweifel/git-auto-commit-action@v4
126128
with:
127129
commit_message: Update dependency versions for release ${{ github.event.inputs.version }}
128-
file_pattern: 'README.md controllers/defaults.go *.yaml Makefile'
130+
file_pattern: 'README.md controllers/defaults.go *.yaml Makefile go.mod go.sum'
129131

130132
- name: Creates a release in GitHub
131133
run: |

0 commit comments

Comments
 (0)