workflow improvements
This commit is contained in:
parent
61d34a8013
commit
8b5bea52a5
1 changed files with 18 additions and 10 deletions
28
.github/workflows/build-multiarch.yml
vendored
28
.github/workflows/build-multiarch.yml
vendored
|
|
@ -1,13 +1,12 @@
|
||||||
name: Release + Docker Images (multi-arch)
|
name: Release + Docker Images (multi-arch)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- 'pyproject.toml'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
|
||||||
update_latest:
|
|
||||||
description: 'Update latest tags (production release)'
|
|
||||||
required: false
|
|
||||||
default: false
|
|
||||||
type: boolean
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-python-packages:
|
build-python-packages:
|
||||||
|
|
@ -31,6 +30,15 @@ jobs:
|
||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
echo "Version: $VERSION"
|
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
|
- name: Build wheel and source distribution
|
||||||
run: |
|
run: |
|
||||||
uv build
|
uv build
|
||||||
|
|
@ -56,7 +64,7 @@ jobs:
|
||||||
tag_name: v${{ steps.version.outputs.version }}
|
tag_name: v${{ steps.version.outputs.version }}
|
||||||
name: Release ${{ steps.version.outputs.version }}
|
name: Release ${{ steps.version.outputs.version }}
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: ${{ steps.version.outputs.is_prerelease }}
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
files: |
|
files: |
|
||||||
dist/*.whl
|
dist/*.whl
|
||||||
|
|
@ -200,8 +208,8 @@ jobs:
|
||||||
phact/openrag-opensearch:$VERSION-amd64 \
|
phact/openrag-opensearch:$VERSION-amd64 \
|
||||||
phact/openrag-opensearch:$VERSION-arm64
|
phact/openrag-opensearch:$VERSION-arm64
|
||||||
|
|
||||||
# Only update latest tags if version is numeric AND checkbox is checked
|
# Only update latest tags if version is numeric
|
||||||
if [[ "$VERSION" =~ ^[0-9.-]+$ ]] && [[ "${{ github.event.inputs.update_latest }}" == "true" ]]; then
|
if [[ "$VERSION" =~ ^[0-9.-]+$ ]]; then
|
||||||
echo "Updating latest tags for production release: $VERSION"
|
echo "Updating latest tags for production release: $VERSION"
|
||||||
docker buildx imagetools create -t phact/openrag-backend:latest \
|
docker buildx imagetools create -t phact/openrag-backend:latest \
|
||||||
phact/openrag-backend:$VERSION-amd64 \
|
phact/openrag-backend:$VERSION-amd64 \
|
||||||
|
|
@ -219,5 +227,5 @@ jobs:
|
||||||
phact/openrag-opensearch:$VERSION-amd64 \
|
phact/openrag-opensearch:$VERSION-amd64 \
|
||||||
phact/openrag-opensearch:$VERSION-arm64
|
phact/openrag-opensearch:$VERSION-arm64
|
||||||
else
|
else
|
||||||
echo "Skipping latest tags - version: $VERSION, update_latest: ${{ github.event.inputs.update_latest }}"
|
echo "Skipping latest tags - version: $VERSION (not numeric)"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue