Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "optimizate upgrade" #140

Merged
merged 1 commit into from
May 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 1 addition & 24 deletions .github/workflows/auto-upgrade-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ env:
on:
schedule:
- cron: "0 20 * * *"
pull_request_target:
types:
- opened
- synchronize
- reopened
workflow_call:
inputs:
dest_tag:
Expand Down Expand Up @@ -79,19 +74,13 @@ jobs:
echo "LATEST_RELEASE_VERISON: ${LATEST_RELEASE_VERISON} "
echo "OLD_VERSION=${LATEST_RELEASE_VERISON}" >> $GITHUB_ENV
fi
elif ${{ github.event_name == 'push' }} ; then
echo "trigger by push"
echo "RUN_TAG=${{ github.sha }}" >> $GITHUB_ENV
elif ${{ github.event_name == 'pull_request_target' }} ; then
echo "trigger by pull_request_target"
echo "RUN_TAG=${{ github.sha }}" >> $GITHUB_ENV
else
# schedule event
# use main sha for ci image tag
echo "trigger by schedule"
echo "RUN_TAG=main" >> $GITHUB_ENV
echo "NEW_VERSION=main" >> $GITHUB_ENV
LATEST_RELEASE_VERISON=$(curl -s https://api.github.com/repos/spidernet-io/spiderpool/releases | grep '"tag_name":' | grep -v "rc" | grep -Eo "v([0-9]+\.[0-9]+\.[0-9])" | sort -r | head -n 1)
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])" | sort -r | head -n 1)
echo "OLD_VERSION=${LATEST_RELEASE_VERISON}" >> $GITHUB_ENV
echo "RUN_E2E_ENABLED=true" >> $GITHUB_ENV
fi
Expand All @@ -100,25 +89,13 @@ jobs:
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
ref: ${{ env.RUN_TAG }}

- name: Result Ref
id: result
run: |
ref=$( git show -s --format='format:%H')
echo "RUN_REF=${ref}" >> $GITHUB_ENV
if ${{ github.event_name == 'push' }} ; then
echo "trigger by push"
echo "NEW_VERSION=${{ github.sha }}" >> $GITHUB_ENV
old_version=$(git log --pretty=format:"%H" | sed -n '2p')
echo "OLD_VERSION=${old_version}" >> $GITHUB_ENV
elif ${{ github.event_name == 'pull_request_target' }} ; then
echo "trigger by pull_request_target"
echo "NEW_VERSION=${{ github.sha }}" >> $GITHUB_ENV
old_version=$(git log --pretty=format:"%H" | sed -n '2p')
echo "OLD_VERSION=${old_version}" >> $GITHUB_ENV
fi

call_build_ci_image:
needs: [get_ref]
Expand Down
Loading