@@ -101,35 +101,17 @@ jobs:
101101 echo "Extracted minor version: ${MINOR_VERSION_WITH_PATCH} from tag: ${RELEASE_TAG}"
102102
103103 # Determine target folder - use version folder for RC releases, main for beta
104- VCLUSTER_CONFIG_BRANCH="main"
105104 if [[ "${RELEASE_TAG}" == *"-rc"* ]]; then
106105 TARGET_VERSION="${MINOR_VERSION_WITH_PATCH}"
107106 echo "RC release detected, using versioned folder: ${TARGET_VERSION}"
108- VCLUSTER_CONFIG_BRANCH="vcluster-v${MAJOR_VERSION}.${MINOR_VERSION}"
109107 else
110108 TARGET_VERSION="main"
111109 echo "Beta release detected, using main folder"
112110 fi
113- echo "Using vcluster-config tag: ${VCLUSTER_CONFIG_BRANCH}"
114111
115112 # clone vcluster-config and vcluster-docs
116113 git clone --single-branch https://github.com/loft-sh/vcluster-docs.git
117114
118- # try to clone the tagged version, if it does not exist, fallback to main
119- git clone --branch "${VCLUSTER_CONFIG_BRANCH}" --depth 1 https://github.com/loft-sh/vcluster-config.git || git clone --single-branch https://github.com/loft-sh/vcluster-config.git
120-
121- # generate vcluster.schema.json based on the current platform.schema.json in vcluster-config
122- # and values.schema.json from alpha / beta release
123- cp chart/values.schema.json vcluster-config/values.schema.json
124- cd vcluster-config/
125- go mod tidy
126- go mod vendor
127-
128- go run ./hack/main.go
129-
130- # copy generated vcluster.schema.json to the docs
131- cd ../
132-
133115 # Check if versioned docs folder exists. If it exists, use it; otherwise use main.
134116 # Versioned folders are created independently by the docs release process.
135117 if [[ -d "vcluster-docs/vcluster_versioned_docs/version-${TARGET_VERSION}" ]]; then
@@ -141,8 +123,8 @@ jobs:
141123 fi
142124
143125 mkdir -p "vcluster-docs/configsrc/vcluster/${DOCS_VERSION}/"
144- cp config /values.yaml "vcluster-docs/configsrc/vcluster/${DOCS_VERSION}/default_values.yaml"
145- cp vcluster-config/vcluster .schema.json "vcluster-docs/configsrc/vcluster/${DOCS_VERSION}/vcluster.schema.json"
126+ cp chart /values.yaml "vcluster-docs/configsrc/vcluster/${DOCS_VERSION}/default_values.yaml"
127+ cp chart/values .schema.json "vcluster-docs/configsrc/vcluster/${DOCS_VERSION}/vcluster.schema.json"
146128
147129 # generate vCluster partials in docs
148130 cd vcluster-docs/
@@ -175,54 +157,3 @@ jobs:
175157 gh pr close "${branch_name}" --comment "Closing to recreate with updated changes from ${RELEASE_TAG}" || true
176158 gh pr create --fill --head "${branch_name}"
177159 echo "Create PR in vcluster-docs"
178-
179-
180- - name : Update vcluster schema in vcluster-config
181- # update only on beta, -rc and stable versions
182- if : ${{ steps.release.outputs.is_alpha_version == 'false' }}
183- env :
184- GH_TOKEN : ${{ secrets.GH_ACCESS_TOKEN }}
185- RELEASE_TAG : ${{ steps.release.outputs.release_tag }}
186- PARSED_VERSION : ${{ steps.semver.outputs.parsed_version }}
187- run : |
188- rm -rf vcluster-config/ || true
189- git clone https://github.com/loft-sh/vcluster-config.git
190- # copy generated schema from vcluster chart values to vcluster-config
191- cp chart/values.schema.json vcluster-config/values.schema.json
192- cp -R config/. vcluster-config/config/
193-
194- cd vcluster-config
195-
196- # We have to replace our config dependency so that we do not introduce vcluster as a whole as transitive dependecy.
197- find ./config/legacyconfig -type f -exec sed -i "s#github.com/loft-sh/vcluster/config#github.com/loft-sh/vcluster-config/config#g" {} +
198-
199- # Align deps, if there have been any relevant changes in vcluster.
200- go mod tidy
201- go mod vendor
202-
203- git add --all
204-
205- # if there are no changes, exit early
206- if git diff-index --quiet HEAD --; then
207- exit 0
208- fi
209- echo "Changes detected"
210-
211- # Determine the tag to update based on the release version
212- # Use parsed version from semver action
213- MAJOR_VERSION=$(echo "${PARSED_VERSION}" | jq -r '.major')
214- MINOR_VERSION=$(echo "${PARSED_VERSION}" | jq -r '.minor')
215-
216- # Use the vcluster-vX.Y format for tags
217- TARGET_TAG="vcluster-v${MAJOR_VERSION}.${MINOR_VERSION}"
218-
219- # commit changes
220- git commit -m "chore: sync config/*.go and values.schema.json to vCluster version ${RELEASE_TAG}"
221-
222- # Update the existing tag to point to the new commit
223- git tag -f "${TARGET_TAG}"
224- # push the commit
225- git push origin HEAD:main
226- git push -u origin -f "${TARGET_TAG}"
227-
228- echo "vcluster-config tag ${TARGET_TAG} updated to vCluster version ${RELEASE_TAG}"
0 commit comments