chore: release nightlies from of release branch (#12181)

* chore: release nightlies from of release branch

in preperation for the new release cycle strategy we will move the nightly to be run off the latest release branch.

One caveat worth documenting: When we create the release branch we need to bump the verions for base and main immediately or else the ngihtly will run off the branch but will use a preveious release tag

I also do not know how to deal with `merge-hash-history-to-main` in this case

* chore: address valid code rabbit comments

add clear error when branch does not exist
make sure valid inputs is respected in the rest of the jobs/steps
release_nightly.yml now uses nightly_tag_release instead of the old nightly_tag_main
This commit is contained in:
Adam-Aghili
2026-03-16 09:21:46 -04:00
committed by GitHub
parent 67d56947e8
commit 8dbcbb0928
4 changed files with 65 additions and 41 deletions

View File

@ -49,9 +49,30 @@ jobs:
run: |
echo "Cannot skip tests while push_to_registry is true."
exit 1
resolve-release-branch:
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.get_branch.outputs.branch }}
steps:
- name: Find latest release branch
id: get_branch
run: |
git ls-remote --heads https://github.com/${{ github.repository }} 'refs/heads/release-*' \
| awk '{print $2}' \
| sed 's|refs/heads/||' \
| sort -V \
| tail -n 1 > branch.txt
BRANCH=$(cat branch.txt)
if [ -z "$BRANCH" ]; then
echo "No release-* branch found in ${{ github.repository }}"
exit 1
fi
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
echo "Using release branch: $BRANCH"
create-nightly-tag:
if: github.repository == 'langflow-ai/langflow'
needs: [validate-inputs, resolve-release-branch]
runs-on: ubuntu-latest
defaults:
run:
@ -60,13 +81,14 @@ jobs:
# Required to create tag
contents: write
outputs:
main_tag: ${{ steps.generate_main_tag.outputs.main_tag }}
release_tag: ${{ steps.generate_release_tag.outputs.release_tag }}
base_tag: ${{ steps.set_base_tag.outputs.base_tag }}
lfx_tag: ${{ steps.generate_lfx_tag.outputs.lfx_tag }}
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
ref: ${{ needs.resolve-release-branch.outputs.branch }}
persist-credentials: true
- name: "Setup Environment"
uses: astral-sh/setup-uv@v6
@ -79,20 +101,20 @@ jobs:
run: uv sync
- name: Generate main nightly tag
id: generate_main_tag
id: generate_release_tag
run: |
# NOTE: This outputs the tag with the `v` prefix.
MAIN_TAG="$(uv run ./scripts/ci/pypi_nightly_tag.py main)"
echo "main_tag=$MAIN_TAG" >> $GITHUB_OUTPUT
echo "main_tag=$MAIN_TAG"
RELEASE_TAG="$(uv run ./scripts/ci/pypi_nightly_tag.py main)"
echo "release_tag=$RELEASE_TAG" >> $GITHUB_OUTPUT
echo "release_tag=$RELEASE_TAG"
- name: Delete existing tag if it exists
id: check_main_tag
id: check_release_tag
run: |
git fetch --tags
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
git tag -d ${{ steps.generate_release_tag.outputs.release_tag }} || true
git push --delete origin ${{ steps.generate_release_tag.outputs.release_tag }} || true
echo "release_tag_exists=false" >> $GITHUB_OUTPUT
- name: Generate base nightly tag
id: generate_base_tag
@ -118,13 +140,13 @@ jobs:
git config --global user.email "bot-nightly-builds@langflow.org"
git config --global user.name "Langflow Bot"
MAIN_TAG="${{ steps.generate_main_tag.outputs.main_tag }}"
RELEASE_TAG="${{ steps.generate_release_tag.outputs.release_tag }}"
BASE_TAG="${{ steps.generate_base_tag.outputs.base_tag }}"
LFX_TAG="${{ steps.generate_lfx_tag.outputs.lfx_tag }}"
echo "Updating LFX project version to $LFX_TAG"
uv run ./scripts/ci/update_lfx_version.py $LFX_TAG
echo "Updating base project version to $BASE_TAG and updating main project version to $MAIN_TAG"
uv run --no-sync ./scripts/ci/update_pyproject_combined.py main $MAIN_TAG $BASE_TAG $LFX_TAG
echo "Updating base project version to $BASE_TAG and updating main project version to $RELEASE_TAG"
uv run --no-sync ./scripts/ci/update_pyproject_combined.py main $RELEASE_TAG $BASE_TAG $LFX_TAG
uv lock
cd src/backend/base && uv lock && cd ../../..
@ -133,14 +155,14 @@ jobs:
git add pyproject.toml src/backend/base/pyproject.toml src/lfx/pyproject.toml uv.lock src/backend/base/uv.lock
git commit -m "Update version and project name"
echo "Tagging main with $MAIN_TAG"
if ! git tag -a $MAIN_TAG -m "Langflow nightly $MAIN_TAG"; then
echo "Tagging main with $RELEASE_TAG"
if ! git tag -a $RELEASE_TAG -m "Langflow nightly $RELEASE_TAG"; then
echo "Tag creation failed. Exiting the workflow."
exit 1
fi
echo "Pushing main tag $MAIN_TAG"
if ! git push origin $MAIN_TAG; then
echo "Pushing main tag $RELEASE_TAG"
if ! git push origin $RELEASE_TAG; then
echo "Tag push failed. Check if the tag already exists. Exiting the workflow."
exit 1
fi
@ -149,7 +171,8 @@ jobs:
- name: Checkout main nightly tag
uses: actions/checkout@v6
with:
ref: ${{ steps.generate_main_tag.outputs.main_tag }}
ref: ${{ steps.generate_release_tag.outputs.release_tag }}
persist-credentials: true
- name: Retrieve Base Tag
id: retrieve_base_tag
@ -217,14 +240,15 @@ jobs:
release-nightly-build:
if: github.repository == 'langflow-ai/langflow' && always() && needs.frontend-tests.result != 'failure' && needs.backend-unit-tests.result != 'failure'
name: Run Nightly Langflow Build
needs: [create-nightly-tag, frontend-tests, backend-unit-tests]
needs:
[validate-inputs, create-nightly-tag, frontend-tests, backend-unit-tests]
uses: ./.github/workflows/release_nightly.yml
with:
build_docker_base: true
build_docker_main: true
build_docker_ep: true
build_lfx: true
nightly_tag_main: ${{ needs.create-nightly-tag.outputs.main_tag }}
nightly_tag_release: ${{ needs.create-nightly-tag.outputs.release_tag }}
nightly_tag_base: ${{ needs.create-nightly-tag.outputs.base_tag }}
nightly_tag_lfx: ${{ needs.create-nightly-tag.outputs.lfx_tag }}
# When triggered by schedule, inputs.push_to_registry is not set, so default to true

View File

@ -24,7 +24,7 @@ on:
required: false
type: boolean
default: false
nightly_tag_main:
nightly_tag_release:
description: "Tag for the nightly main build"
required: true
type: string
@ -60,7 +60,7 @@ jobs:
- name: Check out the code at a specific ref
uses: actions/checkout@v6
with:
ref: ${{ inputs.nightly_tag_main }}
ref: ${{ inputs.nightly_tag_release }}
persist-credentials: true
- name: "Setup Environment"
uses: astral-sh/setup-uv@v6
@ -126,7 +126,7 @@ jobs:
- name: Check out the code at a specific ref
uses: actions/checkout@v6
with:
ref: ${{ inputs.nightly_tag_main }}
ref: ${{ inputs.nightly_tag_release }}
persist-credentials: true
- name: "Setup Environment"
uses: astral-sh/setup-uv@v6
@ -223,7 +223,7 @@ jobs:
- name: Check out the code at a specific ref
uses: actions/checkout@v6
with:
ref: ${{ inputs.nightly_tag_main}}
ref: ${{ inputs.nightly_tag_release}}
persist-credentials: true
- name: "Setup Environment"
uses: astral-sh/setup-uv@v6
@ -269,8 +269,8 @@ jobs:
echo "Name $name does not match langflow-nightly. Exiting the workflow."
exit 1
fi
if [ "$version" != "${{ inputs.nightly_tag_main }}" ]; then
echo "Version $version does not match nightly tag ${{ inputs.nightly_tag_main }}. Exiting the workflow."
if [ "$version" != "${{ inputs.nightly_tag_release }}" ]; then
echo "Version $version does not match nightly tag ${{ inputs.nightly_tag_release }}. Exiting the workflow."
exit 1
fi
# Strip the leading `v` from the version
@ -326,7 +326,7 @@ jobs:
- name: Check out the code
uses: actions/checkout@v6
with:
ref: ${{ inputs.nightly_tag_main }}
ref: ${{ inputs.nightly_tag_release }}
persist-credentials: true
- name: Download LFX artifact
uses: actions/download-artifact@v7
@ -354,7 +354,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v6
with:
ref: ${{ inputs.nightly_tag_main }}
ref: ${{ inputs.nightly_tag_release }}
persist-credentials: true
- name: Download base artifact
uses: actions/download-artifact@v7
@ -382,7 +382,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v6
with:
ref: ${{ inputs.nightly_tag_main }}
ref: ${{ inputs.nightly_tag_release }}
persist-credentials: true
- name: Download main artifact
uses: actions/download-artifact@v7
@ -407,7 +407,7 @@ jobs:
needs: [build-nightly-base, build-nightly-main]
uses: ./.github/workflows/docker-nightly-build.yml
with:
ref: ${{ inputs.nightly_tag_main }}
ref: ${{ inputs.nightly_tag_release }}
release_type: nightly-base
push_to_registry: ${{ inputs.push_to_registry }}
secrets: inherit
@ -418,7 +418,7 @@ jobs:
needs: [build-nightly-main, call_docker_build_base]
uses: ./.github/workflows/docker-nightly-build.yml
with:
ref: ${{ inputs.nightly_tag_main }}
ref: ${{ inputs.nightly_tag_release }}
release_type: nightly-main
push_to_registry: ${{ inputs.push_to_registry }}
secrets: inherit
@ -430,9 +430,9 @@ jobs:
# needs: [build-nightly-main]
# uses: ./.github/workflows/docker-nightly-build.yml
# with:
# ref: ${{ inputs.nightly_tag_main }}
# ref: ${{ inputs.nightly_tag_release }}
# release_type: nightly-main-all
# main_version: ${{ inputs.nightly_tag_main }}
# main_version: ${{ inputs.nightly_tag_release }}
# secrets: inherit
# call_docker_build_main_ep:
@ -441,7 +441,7 @@ jobs:
# needs: [build-nightly-main, call_docker_build_main]
# uses: ./.github/workflows/docker-build-v2.yml
# with:
# ref: ${{ inputs.nightly_tag_main }}
# ref: ${{ inputs.nightly_tag_release }}
# release_type: main-ep
# push_to_registry: ${{ inputs.push_to_registry }}
# secrets: inherit