Files
lancedb/.github/workflows/java-publish.yml
T
Will JonesandClaude Opus 5.5 1806dc2323 ci(java): publish beta releases to Fury instead of Maven Central (#5011)
## Summary

Java publishing has failed since `v0.42.0-beta.10` because the `lancedb`
Sonatype org hit Maven Central's monthly release-count limit:

```text
Publishing blocked: your organization has reached its monthly release count limit. Grace period ended 2026-11-08. Usage resets 2026-12-01.
```

This sends beta tags to `https://maven.fury.io/lancedb/` instead,
matching how Python publishes betas to `pypi.fury.io/lancedb`. Stable
releases still go to Maven Central.

```text
tag contains "beta" -> setup-java server "fury"  -> mvn deploy -P deploy-to-fury
otherwise           -> setup-java server "ossrh" -> mvn deploy -P deploy-to-ossrh
```

- `java/pom.xml`: new `deploy-to-fury` profile that points
`distributionManagement` at Fury.
- `java/README.md`: explains how to add the Fury and `maven.lance.org`
repositories to use a beta.

Requires a `FURY_TOKEN` secret with push access to the `lancedb` Fury
account. The token is passed as the Maven username with a placeholder
password. That follows Gemfury's convention but hasn't been tested
against Fury yet.

## Evidence

Running the beta path locally (`deploy -pl lancedb-core -am -P
deploy-to-fury`) against a file repository deployed `lancedb-parent`
(POM) and `lancedb-core` (JAR, POM, sources, javadoc).
`help:effective-pom -P deploy-to-fury` resolves the release repository
to `https://maven.fury.io/lancedb/`.

## Merge Risk

**Door:** Two-way. This only changes where future betas are published;
reverting the workflow restores Central publishing.
**Blast Radius:** `release-ci`. Beta consumers need the extra
repository; stable consumers are unaffected.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 11:34:14 -08:00

91 lines
3.3 KiB
YAML

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Build and publish Java packages
on:
push:
tags:
- "v*"
pull_request:
paths:
- .github/workflows/java-publish.yml
permissions:
contents: read
jobs:
publish:
name: Build and Publish
runs-on: ubuntu-24.04
timeout-minutes: 30
defaults:
run:
working-directory: ./java
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Java 8
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
cache: "maven"
# Betas go to Fury and stable releases to Maven Central, which limits
# how many releases an organization may publish each month.
server-id: ${{ contains(github.ref, 'beta') && 'fury' || 'ossrh' }}
server-username: ${{ contains(github.ref, 'beta') && 'FURY_TOKEN' || 'SONATYPE_USER' }}
server-password: ${{ contains(github.ref, 'beta') && 'FURY_PASSWORD' || 'SONATYPE_TOKEN' }}
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Set git config
run: |
git config --global user.email "dev+gha@lancedb.com"
git config --global user.name "LanceDB Github Runner"
- name: Dry run
if: github.event_name == 'pull_request'
run: |
./mvnw --batch-mode -DskipTests package -pl lancedb-core -am
- name: Publish to Fury
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'beta')
run: |
./mvnw --batch-mode -DskipTests deploy -pl lancedb-core -am -P deploy-to-fury
env:
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
# Fury authenticates with the token as the username; the password is ignored.
FURY_PASSWORD: NOPASS
- name: Publish to Maven Central
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, 'beta')
run: |
echo "use-agent" >> ~/.gnupg/gpg.conf
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
export GPG_TTY=$(tty)
./mvnw --batch-mode -DskipTests -DpushChanges=false deploy -pl lancedb-core -am -P deploy-to-ossrh
env:
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
report-failure:
name: Report Workflow Failure
runs-on: ubuntu-latest
needs: [publish]
if: always() && failure() && startsWith(github.ref, 'refs/tags/v')
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/create-failure-issue
with:
job-results: ${{ toJSON(needs) }}
workflow-name: ${{ github.workflow }}