Files
firecrawl/.github/workflows/publish-java-sdk.yml
capy-ai[bot] 604eb26e3f ci: show a release summary and supersede unapproved release runs (#5413)
* ci: show a release summary before release approval

* ci: run the Elixir release summary from the repository root

* ci: supersede release runs still waiting for approval

---------

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
2026-11-02 22:07:15 +01:00

141 lines
4.8 KiB
YAML

name: Publish Java SDK
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'apps/java-sdk/**'
permissions: {}
jobs:
supersede:
name: Supersede unapproved runs
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
continue-on-error: true
with:
sparse-checkout: .github/actions
persist-credentials: false
- uses: ./.github/actions/supersede-waiting-runs
continue-on-error: true
timeout-minutes: 2
release-summary:
name: Release summary
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: read
actions: read
pull-requests: read
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
continue-on-error: true
with:
fetch-depth: 0
filter: blob:none
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
continue-on-error: true
with:
python-version: '3.x'
- name: Install version check dependencies
continue-on-error: true
run: |
python -m pip install --no-cache-dir -r .github/pip-bootstrap.txt
python -m pip install requests==2.34.2 packaging==26.3
- name: Read the version
id: version
continue-on-error: true
run: |
echo "version=$(sed -nE 's/^version *= *"([^"]+)".*/\1/p' apps/java-sdk/build.gradle.kts)" >> "$GITHUB_OUTPUT"
echo "publishes=$(python .github/scripts/check_version_has_incremented.py java ./apps/java-sdk com.firecrawl:firecrawl-java)" >> "$GITHUB_OUTPUT"
- uses: ./.github/actions/release-summary
continue-on-error: true
timeout-minutes: 3
with:
gated-job: Publish to Maven Central
version: com.firecrawl:firecrawl-java ${{ steps.version.outputs.version }}
publishes: ${{ steps.version.outputs.publishes }}
published-step: Publish to Maven Central
paths: apps/java-sdk
publish:
name: Publish to Maven Central
needs: release-summary
if: github.ref == 'refs/heads/main'
runs-on: blacksmith-2vcpu-ubuntu-2404
environment: release
concurrency:
group: ${{ github.workflow }}-release-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: '3.x'
- name: Install version check dependencies
run: |
python -m pip install --no-cache-dir -r .github/pip-bootstrap.txt
pip install requests packaging
- name: Run version check script
id: version_check
run: |
VERSION_INCREMENTED=$(python .github/scripts/check_version_has_incremented.py java ./apps/java-sdk com.firecrawl:firecrawl-java)
echo "VERSION_INCREMENTED=$VERSION_INCREMENTED" >> $GITHUB_ENV
- name: Set up JDK 11
if: ${{ env.VERSION_INCREMENTED == 'true' }}
uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4
with:
distribution: temurin
java-version: '11'
- name: Cache Gradle packages
if: ${{ env.VERSION_INCREMENTED == 'true' }}
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('apps/java-sdk/**/*.gradle.kts', 'apps/java-sdk/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
if: ${{ env.VERSION_INCREMENTED == 'true' }}
working-directory: ./apps/java-sdk
run: chmod +x gradlew
- name: Build
if: ${{ env.VERSION_INCREMENTED == 'true' }}
working-directory: ./apps/java-sdk
run: ./gradlew build -x test
- name: Publish to Maven Central
if: ${{ env.VERSION_INCREMENTED == 'true' }}
working-directory: ./apps/java-sdk
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SIGNING_PASSWORD }}
run: ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache