Skip to content

Commit

Permalink
clean up version handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanrfrazier committed Oct 17, 2024
1 parent 61f7ed6 commit 792f485
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 13 deletions.
35 changes: 27 additions & 8 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,30 @@ jobs:
exit 1
fi
version=${{ inputs.version }}
# strip leading v if present
version=${version#v}
echo version=$version
echo version=$version >> $GITHUB_OUTPUT
if [[ "${{ steps.resolve-nightly-tag.outputs.nightly-tag }}" != '' ]]; then
if [[ "${{ inputs.nightly_tag_main }}" == '' ]]; then
echo "Must specify a main nightly tag to check out when building base image."
echo "Nightly tag main is empty. Exiting the workflow."
exit 1
fi
echo "main nightly version=${{ inputs.nightly_tag_main }}"
echo "base nightly version=${{ inputs.nightly_tag_base }}"
echo "building image for nightly_version=${{ steps.resolve-nightly-tag.outputs.nightly-tag }}"
# Strip leading v from nightly tag main if present
version=${{ inputs.nightly_tag_main }}
version=${version#v}
echo version=$version >> $GITHUB_OUTPUT
elif [[ "${{ inputs.version }}" != '' ]]; then
# strip leading v if present
version=${{ inputs.version }}
version=${version#v}
echo version=$version
echo version=$version >> $GITHUB_OUTPUT
else
echo "No version or ref specified. Exiting the workflow."
exit 1
fi
- name: Get Version Base
if: ${{ inputs.version == '' && inputs.release_type == 'base' }}
id: get-version-base
Expand Down Expand Up @@ -189,7 +208,7 @@ jobs:
- name: Check out the code at a specific ref
uses: actions/checkout@v4
with:
ref: ${{ inputs.nightly_tag_main || needs.get-version.outputs.version || github.ref }}
ref: ${{ needs.get-version.outputs.version || github.ref }}
persist-credentials: true
- name: "Setup Environment"
uses: ./.github/actions/setup-uv
Expand Down Expand Up @@ -265,7 +284,7 @@ jobs:
- name: Check out the code at a specific ref
uses: actions/checkout@v4
with:
ref: ${{ inputs.nightly_tag_main || needs.get-version.outputs.version || github.ref }}
ref: ${{ needs.get-version.outputs.version || github.ref }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down Expand Up @@ -313,7 +332,7 @@ jobs:
- name: Check out the code at a specific ref
uses: actions/checkout@v4
with:
ref: ${{ inputs.nightly_tag_main || needs.get-version.outputs.version || github.ref }}
ref: ${{ needs.get-version.outputs.version || github.ref }}
- name: "Setup Environment"
uses: ./.github/actions/setup-uv

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ jobs:
pre_release: ${{ inputs.pre_release }}
secrets: inherit

call_docker_build_ep:
call_docker_build_main_ep:
name: Call Docker Build Workflow for Langflow with Entrypoint
if: inputs.build_docker_ep == true
uses: ./.github/workflows/docker-build.yml
Expand Down
26 changes: 22 additions & 4 deletions .github/workflows/release_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ on:
required: true
type: boolean
default: false
build_docker_ep:
description: "Build Docker Image for Langflow Nightly with Entrypoint"
required: false
type: boolean
default: false
nightly_tag_main:
description: "Tag for the nightly main build"
required: true
Expand All @@ -34,6 +39,11 @@ on:
required: true
type: boolean
default: false
build_docker_ep:
description: "Build Docker Image for Langflow Nightly with Entrypoint"
required: false
type: boolean
default: false
nightly_tag_main:
description: "Tag for the nightly main build"
required: true
Expand Down Expand Up @@ -197,8 +207,6 @@ jobs:
needs: [release-nightly-base, release-nightly-main]
uses: ./.github/workflows/docker-build.yml
with:
# Version should _not_ contain the leading `v`
version: ${{ needs.release-nightly-base.outputs.version }}
release_type: base
nightly_tag_base: ${{ inputs.nightly_tag_base }}
nightly_tag_main: ${{ inputs.nightly_tag_main }}
Expand All @@ -210,10 +218,20 @@ jobs:
needs: [release-nightly-main]
uses: ./.github/workflows/docker-build.yml
with:
# Version should _not_ contain the leading `v`
version: ${{ needs.release-nightly-main.outputs.version }}
release_type: main
nightly_tag_main: ${{ inputs.nightly_tag_main }}
secrets: inherit

call_docker_build_main_ep:
name: Call Docker Build Workflow for Langflow with Entrypoint
if: always() && ${{ inputs.build_docker_ep == 'true' }}
needs: [release-nightly-main]
uses: ./.github/workflows/docker-build.yml
with:
release_type: main-ep
nightly_tag_main: ${{ inputs.nightly_tag_main }}
secrets: inherit




0 comments on commit 792f485

Please sign in to comment.