Skip to content

Commit

Permalink
ci: Update nightly build workflow to delete existing main tags before…
Browse files Browse the repository at this point in the history
… generating new ones (langflow-ai#5694)
  • Loading branch information
ogabrielluiz authored and mieslep committed Jan 15, 2025
1 parent 3294e62 commit cc0a906
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/nightly_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,16 @@ jobs:
echo "main_tag=$MAIN_TAG" >> $GITHUB_OUTPUT
echo "main_tag=$MAIN_TAG"
- name: Check if main tag already exists
- name: Delete existing tag if it exists
id: check_main_tag
run: |
git fetch --tags
if git rev-parse -q --verify "refs/tags/${{ steps.generate_main_tag.outputs.main_tag }}" >/dev/null; then
echo "main_tag_exists=true" >> $GITHUB_OUTPUT
else
echo "main_tag_exists=false" >> $GITHUB_OUTPUT
fi
git tag -d ${{ steps.generate_main_tag.outputs.main_tag }} || true
git push --delete origin ${{ steps.generate_main_tag.outputs.main_tag }} || true
echo "main_tag_exists=false" >> $GITHUB_OUTPUT
- name: Generate base nightly tag
id: generate_base_tag
if: ${{ steps.check_main_tag.outputs.main_tag_exists == 'false' }}
run: |
# NOTE: This outputs the tag with the `v` prefix.
BASE_TAG="$(uv run ./scripts/ci/pypi_nightly_tag.py base)"
Expand All @@ -62,7 +59,6 @@ jobs:
- name: Commit tag
id: commit_tag
if: ${{ steps.check_main_tag.outputs.main_tag_exists == 'false' }}
run: |
# If the main tag does not exist in GH, we create the base tag from the existing codebase.
Expand Down Expand Up @@ -95,13 +91,11 @@ jobs:
- name: Checkout main nightly tag
uses: actions/checkout@v4
if: ${{ steps.check_main_tag.outputs.main_tag_exists == 'true' }}
with:
ref: ${{ steps.generate_main_tag.outputs.main_tag }}

- name: Retrieve Base Tag
id: retrieve_base_tag
if: ${{ steps.check_main_tag.outputs.main_tag_exists == 'true' }}
working-directory: src/backend/base
run: |
# If the main tag already exists, we need to retrieve the base version from the main tag codebase.
Expand Down

0 comments on commit cc0a906

Please sign in to comment.