Skip to content

Commit

Permalink
Bugfix release branch name (#250)
Browse files Browse the repository at this point in the history
* fix: bugfix release branch name bug

Signed-off-by: hlts2 <[email protected]>

* fix: use collect tag

Signed-off-by: hlts2 <[email protected]>

* fix: use collect code

Signed-off-by: hlts2 <[email protected]>

---------

Signed-off-by: hlts2 <[email protected]>
  • Loading branch information
hlts2 authored Apr 18, 2024
1 parent d13b289 commit fdb24be
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/_sync-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -70,13 +69,17 @@ 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}
fi
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:
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/_sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
6 changes: 3 additions & 3 deletions .github/workflows/matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: "Sync Vald"
on:
workflow_dispatch:
pull_request:
# pull_request:

env:
CI_TOKEN: ${{ secrets.DISPATCH_TOKEN }}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fdb24be

Please sign in to comment.