From fdb24be24ec5f69a3b365151fba333e9a8047b1b Mon Sep 17 00:00:00 2001 From: Hiroto Funakoshi Date: Thu, 18 Apr 2024 16:59:48 +0900 Subject: [PATCH] Bugfix release branch name (#250) * fix: bugfix release branch name bug Signed-off-by: hlts2 * fix: use collect tag Signed-off-by: hlts2 * fix: use collect code Signed-off-by: hlts2 --------- Signed-off-by: hlts2 --- .github/workflows/_sync-version.yaml | 7 +++++-- .github/workflows/_sync.yaml | 24 ++++++++++++------------ .github/workflows/matrix.yaml | 6 +++--- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/_sync-version.yaml b/.github/workflows/_sync-version.yaml index 11c806c0..3f5acc45 100644 --- a/.github/workflows/_sync-version.yaml +++ b/.github/workflows/_sync-version.yaml @@ -18,7 +18,7 @@ on: workflow_call: inputs: vald_checkout_src_tag_ref: - description: "Switch tag or restore working tree files to build vald" + description: "Switch tag or restore working tree files to build vald (e.g. v1.7.12)" type: string required: true client_checkout_target_ref: @@ -37,7 +37,6 @@ on: env: IMAGES: "vdaas/vald-agent-ngt vdaas/vald-discoverer-k8s vdaas/vald-lb-gateway vdaas/vald-manager-index" IMAGE_TAG: ${{ inputs.vald_checkout_src_tag_ref }} # v1.7.12 - RELEASE_BRANCH_NAME: release/${{ inputs.vald_checkout_src_tag_ref }} # release/v1.7.12 jobs: prepare: @@ -70,6 +69,8 @@ jobs: - name: Create branch id: create_release_branch run: | + RELEASE_BRANCH_NAME="release/$(echo "${TAG_REF}" | awk -F '.' '{print $1"."$2}')" # release/v1.7 + BRANCH_EXIST=$(git fetch origin "${RELEASE_BRANCH_NAME}" && echo true || echo false) if [ "${BRANCH_EXIST}" != "true" ]; then git checkout -b ${RELEASE_BRANCH_NAME} && git push origin ${RELEASE_BRANCH_NAME} @@ -77,6 +78,8 @@ jobs: echo "RELEASE_BRANCH_NAME=${RELEASE_BRANCH_NAME}" >> $GITHUB_OUTPUT echo "RELEASE_BRANCH_NAME=${RELEASE_BRANCH_NAME}" + env: + TAG_REF: ${{ inputs.vald_checkout_src_tag_ref }} sync-version: needs: diff --git a/.github/workflows/_sync.yaml b/.github/workflows/_sync.yaml index dab44c68..709e310c 100644 --- a/.github/workflows/_sync.yaml +++ b/.github/workflows/_sync.yaml @@ -65,15 +65,15 @@ jobs: echo "commit and push" SHA="$(make vald/sha/print)" - # git remote set-url origin https://${CI_USER}:${CI_TOKEN}@github.com/$GITHUB_REPOSITORY - # git add . - # git commit -S --signoff -m "Update [vald sha: ${SHA}]" - # git push - # - name: Create tag - # if: ${{ inputs.enable_tag_push == true }} - # continue-on-error: true - # run: | - # version="$(make vald/client/python/version/print)" - # git remote set-url origin "https://${CI_USER}:${CI_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" - # git tag ${version} - # git push origin ${version} + git remote set-url origin https://${CI_USER}:${CI_TOKEN}@github.com/$GITHUB_REPOSITORY + git add . + git commit -S --signoff -m "Update [vald sha: ${SHA}]" + git push + - name: Create tag + if: ${{ inputs.enable_tag_push == true }} + continue-on-error: true + run: | + version="$(make vald/client/python/version/print)" + git remote set-url origin "https://${CI_USER}:${CI_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" + git tag ${version} + git push origin ${version} diff --git a/.github/workflows/matrix.yaml b/.github/workflows/matrix.yaml index 89cb32f4..7493e9fd 100644 --- a/.github/workflows/matrix.yaml +++ b/.github/workflows/matrix.yaml @@ -4,7 +4,7 @@ name: "Sync Vald" on: workflow_dispatch: - pull_request: + # pull_request: env: CI_TOKEN: ${{ secrets.DISPATCH_TOKEN }} @@ -45,8 +45,8 @@ jobs: max-parallel: ${{ fromJson(needs.check-version.outputs.TAG_DIFF_LIST_JSON_LEN) }} matrix: # TODO: change job id - # vald_checkout_src_tag_ref: ${{ fromJson(needs.check-version.outputs.TAG_DIFF_LIST_JSON) }} - vald_checkout_src_tag_ref: ${{ fromJson(needs.check-version-for-debug.outputs.JSON) }} + vald_checkout_src_tag_ref: ${{ fromJson(needs.check-version.outputs.TAG_DIFF_LIST_JSON) }} + # vald_checkout_src_tag_ref: ${{ fromJson(needs.check-version-for-debug.outputs.JSON) }} with: vald_checkout_src_tag_ref: ${{ matrix.vald_checkout_src_tag_ref }} client_checkout_target_ref: main