From 8b5bea52a53ad70432250faf1678645c93cba8e0 Mon Sep 17 00:00:00 2001 From: phact Date: Tue, 7 Oct 2025 12:43:49 -0400 Subject: [PATCH] workflow improvements --- .github/workflows/build-multiarch.yml | 28 +++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index cbe8bf16..e05d2330 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -1,13 +1,12 @@ name: Release + Docker Images (multi-arch) on: + push: + branches: + - main + paths: + - 'pyproject.toml' workflow_dispatch: - inputs: - update_latest: - description: 'Update latest tags (production release)' - required: false - default: false - type: boolean jobs: build-python-packages: @@ -31,6 +30,15 @@ jobs: echo "version=$VERSION" >> $GITHUB_OUTPUT echo "Version: $VERSION" + # Check if version is numeric (e.g., 0.1.16) vs prerelease (e.g., 0.1.16-rc1) + if [[ "$VERSION" =~ ^[0-9.-]+$ ]]; then + echo "is_prerelease=false" >> $GITHUB_OUTPUT + echo "Release type: Production" + else + echo "is_prerelease=true" >> $GITHUB_OUTPUT + echo "Release type: Prerelease" + fi + - name: Build wheel and source distribution run: | uv build @@ -56,7 +64,7 @@ jobs: tag_name: v${{ steps.version.outputs.version }} name: Release ${{ steps.version.outputs.version }} draft: false - prerelease: false + prerelease: ${{ steps.version.outputs.is_prerelease }} generate_release_notes: true files: | dist/*.whl @@ -200,8 +208,8 @@ jobs: phact/openrag-opensearch:$VERSION-amd64 \ phact/openrag-opensearch:$VERSION-arm64 - # Only update latest tags if version is numeric AND checkbox is checked - if [[ "$VERSION" =~ ^[0-9.-]+$ ]] && [[ "${{ github.event.inputs.update_latest }}" == "true" ]]; then + # Only update latest tags if version is numeric + if [[ "$VERSION" =~ ^[0-9.-]+$ ]]; then echo "Updating latest tags for production release: $VERSION" docker buildx imagetools create -t phact/openrag-backend:latest \ phact/openrag-backend:$VERSION-amd64 \ @@ -219,5 +227,5 @@ jobs: phact/openrag-opensearch:$VERSION-amd64 \ phact/openrag-opensearch:$VERSION-arm64 else - echo "Skipping latest tags - version: $VERSION, update_latest: ${{ github.event.inputs.update_latest }}" + echo "Skipping latest tags - version: $VERSION (not numeric)" fi