mirror of
https://github.com/lancedb/lancedb.git
synced 2026-10-18 01:32:27 +00:00
fix: preserve the stable Java release version
This commit is contained in:
@@ -12,6 +12,13 @@
|
||||
|
||||
name: Build and publish Java packages
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
dry_run:
|
||||
description: Build without publishing to Maven Central
|
||||
type: boolean
|
||||
default: true
|
||||
required: true
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
@@ -48,12 +55,25 @@ jobs:
|
||||
run: |
|
||||
git config --global user.email "dev+gha@lancedb.com"
|
||||
git config --global user.name "LanceDB Github Runner"
|
||||
- name: Validate package version
|
||||
run: |
|
||||
python - <<'PYTHON'
|
||||
import tomllib
|
||||
import xml.etree.ElementTree as ET
|
||||
from pathlib import Path
|
||||
|
||||
expected = tomllib.loads(Path("../.bumpversion.toml").read_text())["tool"]["bumpversion"]["current_version"]
|
||||
actual = ET.parse("pom.xml").findtext("{http://maven.apache.org/POM/4.0.0}version")
|
||||
if actual != expected:
|
||||
raise ValueError(f"Maven version {actual} differs from release version {expected}")
|
||||
print(f"Validated Maven version {actual}")
|
||||
PYTHON
|
||||
- name: Dry run
|
||||
if: github.event_name == 'pull_request'
|
||||
if: github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.dry_run)
|
||||
run: |
|
||||
./mvnw --batch-mode -DskipTests package -pl lancedb-core -am
|
||||
- name: Publish
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && !inputs.dry_run)
|
||||
run: |
|
||||
echo "use-agent" >> ~/.gnupg/gpg.conf
|
||||
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
|
||||
@@ -68,7 +88,7 @@ jobs:
|
||||
name: Report Workflow Failure
|
||||
runs-on: ubuntu-latest
|
||||
needs: [publish]
|
||||
if: always() && failure() && startsWith(github.ref, 'refs/tags/v')
|
||||
if: always() && failure() && (startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && !inputs.dry_run))
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
|
||||
Reference in New Issue
Block a user