Skip to content

Commit

Permalink
ci: optimize upgrade
Browse files Browse the repository at this point in the history
Signed-off-by: tao.yang <[email protected]>
  • Loading branch information
ty-dc committed Apr 28, 2024
1 parent 73e01b4 commit b212cec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/auto-upgrade-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- cron: "0 20 * * *"
workflow_call:
inputs:
dest_tag:
ref:
required: true
type: string
workflow_dispatch:
Expand Down Expand Up @@ -57,12 +57,12 @@ jobs:
else
echo "RUN_E2E_ENABLED=false" >> $GITHUB_ENV
fi
elif ${{ inputs.dest_tag != '' }}; then
elif ${{ inputs.ref != '' }}; then
echo "call by workflow_call"
echo "RUN_TAG=${{ inputs.dest_tag }}" >> $GITHUB_ENV
echo "NEW_VERSION=${{ inputs.dest_tag }}" >> $GITHUB_ENV
echo "RUN_TAG=${{ inputs.ref }}" >> $GITHUB_ENV
echo "NEW_VERSION=${{ inputs.ref }}" >> $GITHUB_ENV
echo "RUN_E2E_ENABLED=true" >> $GITHUB_ENV
YBranchName=` grep -Eo "v[0-9]+\.[0-9]+" <<< "${{ inputs.dest_tag }}" `
YBranchName=` grep -Eo "v[0-9]+\.[0-9]+" <<< "${{ inputs.ref }}" `
# Get the previous minor version of version y
LATEST_RELEASE_VERISON=$(curl -s https://api.github.com/repos/spidernet-io/spiderpool/releases | grep '"tag_name":' | grep -Eo "v([0-9]+\.[0-9]+\.[0-9])" | grep ${YBranchName} | sort -r | head -n 1)
if [ -z "${LATEST_RELEASE_VERISON}" ]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto-version-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
needs: [build-release-image, get-tag]
uses: ./.github/workflows/auto-upgrade-ci.yaml
with:
dest_tag: ${{ needs.get-tag.outputs.tag }}
ref: ${{ needs.get-tag.outputs.tag }}
secrets: inherit

update-release-version:
Expand Down

0 comments on commit b212cec

Please sign in to comment.