ci: Update nightly build workflow to delete existing main tags before generating new ones (#5694)
This commit is contained in:
parent
da83dbbcb5
commit
8a4fc2c338
1 changed files with 4 additions and 10 deletions
12
.github/workflows/nightly_build.yml
vendored
12
.github/workflows/nightly_build.yml
vendored
|
|
@ -41,19 +41,16 @@ jobs:
|
||||||
echo "main_tag=$MAIN_TAG" >> $GITHUB_OUTPUT
|
echo "main_tag=$MAIN_TAG" >> $GITHUB_OUTPUT
|
||||||
echo "main_tag=$MAIN_TAG"
|
echo "main_tag=$MAIN_TAG"
|
||||||
|
|
||||||
- name: Check if main tag already exists
|
- name: Delete existing tag if it exists
|
||||||
id: check_main_tag
|
id: check_main_tag
|
||||||
run: |
|
run: |
|
||||||
git fetch --tags
|
git fetch --tags
|
||||||
if git rev-parse -q --verify "refs/tags/${{ steps.generate_main_tag.outputs.main_tag }}" >/dev/null; then
|
git tag -d ${{ steps.generate_main_tag.outputs.main_tag }} || true
|
||||||
echo "main_tag_exists=true" >> $GITHUB_OUTPUT
|
git push --delete origin ${{ steps.generate_main_tag.outputs.main_tag }} || true
|
||||||
else
|
|
||||||
echo "main_tag_exists=false" >> $GITHUB_OUTPUT
|
echo "main_tag_exists=false" >> $GITHUB_OUTPUT
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Generate base nightly tag
|
- name: Generate base nightly tag
|
||||||
id: generate_base_tag
|
id: generate_base_tag
|
||||||
if: ${{ steps.check_main_tag.outputs.main_tag_exists == 'false' }}
|
|
||||||
run: |
|
run: |
|
||||||
# NOTE: This outputs the tag with the `v` prefix.
|
# NOTE: This outputs the tag with the `v` prefix.
|
||||||
BASE_TAG="$(uv run ./scripts/ci/pypi_nightly_tag.py base)"
|
BASE_TAG="$(uv run ./scripts/ci/pypi_nightly_tag.py base)"
|
||||||
|
|
@ -62,7 +59,6 @@ jobs:
|
||||||
|
|
||||||
- name: Commit tag
|
- name: Commit tag
|
||||||
id: commit_tag
|
id: commit_tag
|
||||||
if: ${{ steps.check_main_tag.outputs.main_tag_exists == 'false' }}
|
|
||||||
run: |
|
run: |
|
||||||
# If the main tag does not exist in GH, we create the base tag from the existing codebase.
|
# If the main tag does not exist in GH, we create the base tag from the existing codebase.
|
||||||
|
|
||||||
|
|
@ -95,13 +91,11 @@ jobs:
|
||||||
|
|
||||||
- name: Checkout main nightly tag
|
- name: Checkout main nightly tag
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
if: ${{ steps.check_main_tag.outputs.main_tag_exists == 'true' }}
|
|
||||||
with:
|
with:
|
||||||
ref: ${{ steps.generate_main_tag.outputs.main_tag }}
|
ref: ${{ steps.generate_main_tag.outputs.main_tag }}
|
||||||
|
|
||||||
- name: Retrieve Base Tag
|
- name: Retrieve Base Tag
|
||||||
id: retrieve_base_tag
|
id: retrieve_base_tag
|
||||||
if: ${{ steps.check_main_tag.outputs.main_tag_exists == 'true' }}
|
|
||||||
working-directory: src/backend/base
|
working-directory: src/backend/base
|
||||||
run: |
|
run: |
|
||||||
# If the main tag already exists, we need to retrieve the base version from the main tag codebase.
|
# If the main tag already exists, we need to retrieve the base version from the main tag codebase.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue