Skip to content

JVM Publish

JVM Publish #40

Workflow file for this run

name: JVM Publish
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: "Version/tag to publish (e.g., v0.7.0-rc.54 or 0.7.0-rc.54)"
required: true
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Normalize release version
id: version
shell: bash
run: |
VERSION="${{ github.event.inputs.version || github.event.release.tag_name || github.ref_name }}"
TAG="$VERSION"
if [[ "$TAG" != v* ]]; then
TAG="v$TAG"
fi
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "version=${TAG#v}" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
with:
ref: ${{ steps.version.outputs.tag }}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
server-id: github
settings-path: ${{ github.workspace }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build with Gradle
working-directory: bindings/kotlin/ldk-node-jvm
run: ./gradlew build -x test -Pversion=${{ steps.version.outputs.version }}
- name: Publish to GitHub Packages
working-directory: bindings/kotlin/ldk-node-jvm
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ github.token }}
GITHUB_REPO: ${{ github.repository }}
run: ./gradlew publish -Pversion=${{ steps.version.outputs.version }}