mirror of
https://github.com/HDFGroup/hdf5.git
synced 2026-09-25 04:09:44 +03:00
FFM build requires Java 25, Jextract 25. Generates FFM bindings during configure. JNI is default when the requirements are not met or can be forced. Presets added for maven and FFM - JNI is default selection. Enhanced Maven options will work with either JNI or FFM New Workflows for testing and maven uploads. Extensive documentation changes for java.
203 lines
7.7 KiB
YAML
203 lines
7.7 KiB
YAML
name: hdf5 dev release build
|
|
|
|
# Triggers the workflow on demand
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
use_tag:
|
|
description: 'Release version tag'
|
|
type: string
|
|
required: false
|
|
default: snapshot
|
|
deploy_maven:
|
|
description: 'Deploy artifacts to Maven repository'
|
|
type: boolean
|
|
required: false
|
|
default: false
|
|
maven_repository:
|
|
description: 'Maven repository type'
|
|
type: choice
|
|
options:
|
|
- github-packages
|
|
- maven-central-staging
|
|
required: false
|
|
default: github-packages
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
log-the-inputs:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
rel_tag: ${{ steps.get-tag-name.outputs.RELEASE_TAG }}
|
|
steps:
|
|
- name: Get tag name
|
|
id: get-tag-name
|
|
env:
|
|
TAG: ${{ inputs.use_tag }}
|
|
run: echo "RELEASE_TAG=$TAG" >> $GITHUB_OUTPUT
|
|
|
|
call-workflow-tarball:
|
|
needs: log-the-inputs
|
|
uses: ./.github/workflows/tarball.yml
|
|
with:
|
|
use_tag: ${{ needs.log-the-inputs.outputs.rel_tag }}
|
|
use_environ: release
|
|
|
|
call-aws-c-s3-build:
|
|
needs: call-workflow-tarball
|
|
name: "Build aws-c-s3 library"
|
|
uses: ./.github/workflows/build-aws-c-s3.yml
|
|
with:
|
|
build_mode: "Release"
|
|
# Use latest release for building from source on Ubuntu
|
|
# until a package is available to install
|
|
aws_c_s3_tag: "v0.8.0"
|
|
|
|
call-workflow-ctest:
|
|
needs: [call-workflow-tarball, call-aws-c-s3-build]
|
|
uses: ./.github/workflows/ctest.yml
|
|
with:
|
|
cmake_version: "latest"
|
|
preset_name: ci-StdShar
|
|
file_base: ${{ needs.call-workflow-tarball.outputs.file_base }}
|
|
snap_name: hdf5-${{ needs.call-workflow-tarball.outputs.source_base }}
|
|
use_environ: release
|
|
secrets:
|
|
APPLE_CERTS_BASE64: ${{ secrets.APPLE_CERTS_BASE64 }}
|
|
APPLE_CERTS_BASE64_PASSWD: ${{ secrets.APPLE_CERTS_BASE64_PASSWD }}
|
|
KEYCHAIN_PASSWD: ${{ secrets.KEYCHAIN_PASSWD }}
|
|
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
|
|
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
|
|
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
|
|
AZURE_ENDPOINT: ${{ secrets.AZURE_ENDPOINT }}
|
|
AZURE_CODE_SIGNING_NAME: ${{ secrets.AZURE_CODE_SIGNING_NAME }}
|
|
AZURE_CERT_PROFILE_NAME: ${{ secrets.AZURE_CERT_PROFILE_NAME }}
|
|
|
|
call-workflow-abi:
|
|
needs: [log-the-inputs, call-workflow-tarball, call-workflow-ctest]
|
|
uses: ./.github/workflows/abi-report.yml
|
|
with:
|
|
file_ref: '1.14.5'
|
|
file_base: ${{ needs.call-workflow-tarball.outputs.file_base }}
|
|
use_tag: ${{ needs.log-the-inputs.outputs.rel_tag }}
|
|
use_environ: release
|
|
|
|
call-workflow-release:
|
|
needs: [log-the-inputs, call-workflow-tarball, call-workflow-ctest, call-workflow-abi]
|
|
permissions:
|
|
contents: write # In order to allow tag creation
|
|
uses: ./.github/workflows/release-files.yml
|
|
with:
|
|
file_base: ${{ needs.call-workflow-tarball.outputs.file_base }}
|
|
file_branch: ${{ needs.call-workflow-tarball.outputs.file_branch }}
|
|
file_sha: ${{ needs.call-workflow-tarball.outputs.file_sha }}
|
|
use_tag: ${{ needs.log-the-inputs.outputs.rel_tag }}
|
|
use_environ: release
|
|
|
|
call-workflow-maven-staging:
|
|
needs: [log-the-inputs, call-workflow-tarball]
|
|
if: ${{ inputs.deploy_maven == true }}
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
pull-requests: write
|
|
uses: ./.github/workflows/maven-staging.yml
|
|
with:
|
|
test_maven_deployment: true
|
|
use_snapshot_version: ${{ needs.log-the-inputs.outputs.rel_tag == 'snapshot' }}
|
|
platforms: 'all-platforms'
|
|
java_implementation: 'both' # Build both FFM and JNI implementations
|
|
|
|
deploy-maven-artifacts:
|
|
name: Deploy Maven Artifacts (FFM & JNI)
|
|
needs: [log-the-inputs, call-workflow-tarball, call-workflow-ctest, call-workflow-abi, call-workflow-maven-staging]
|
|
if: ${{ inputs.deploy_maven == true }}
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write # For GitHub Packages deployment
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
# Linux artifacts
|
|
- implementation: ffm
|
|
artifact-name: maven-staging-artifacts-linux-x86_64-ffm
|
|
- implementation: jni
|
|
artifact-name: maven-staging-artifacts-linux-x86_64-jni
|
|
# Windows artifacts
|
|
- implementation: ffm
|
|
artifact-name: maven-staging-artifacts-windows-x86_64-ffm
|
|
- implementation: jni
|
|
artifact-name: maven-staging-artifacts-windows-x86_64-jni
|
|
# macOS x86_64 artifacts
|
|
- implementation: ffm
|
|
artifact-name: maven-staging-artifacts-macos-x86_64-ffm
|
|
- implementation: jni
|
|
artifact-name: maven-staging-artifacts-macos-x86_64-jni
|
|
# macOS aarch64 artifacts
|
|
- implementation: ffm
|
|
artifact-name: maven-staging-artifacts-macos-aarch64-ffm
|
|
- implementation: jni
|
|
artifact-name: maven-staging-artifacts-macos-aarch64-jni
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v5.0.0
|
|
|
|
- name: Set up JDK 21
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
java-version: '21'
|
|
distribution: 'temurin'
|
|
server-id: ${{ inputs.maven_repository == 'github-packages' && 'github' || 'ossrh' }}
|
|
server-username: MAVEN_USERNAME
|
|
server-password: MAVEN_PASSWORD
|
|
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
|
|
gpg-passphrase: GPG_PASSPHRASE
|
|
|
|
- name: Download Maven artifacts (${{ matrix.artifact-name }})
|
|
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
|
|
with:
|
|
name: ${{ matrix.artifact-name }}
|
|
path: ./maven-artifacts
|
|
continue-on-error: true
|
|
|
|
- name: Deploy to Maven repository
|
|
if: hashFiles('maven-artifacts/**') != ''
|
|
env:
|
|
MAVEN_USERNAME: ${{ inputs.maven_repository == 'github-packages' && github.actor || secrets.MAVEN_CENTRAL_USERNAME }}
|
|
MAVEN_PASSWORD: ${{ inputs.maven_repository == 'github-packages' && secrets.GITHUB_TOKEN || secrets.MAVEN_CENTRAL_PASSWORD }}
|
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
|
REPOSITORY_URL: ${{ inputs.maven_repository == 'github-packages' && format('https://maven.pkg.github.com/{0}', github.repository) || 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/' }}
|
|
REPOSITORY_ID: ${{ inputs.maven_repository == 'github-packages' && 'github' || 'ossrh' }}
|
|
run: |
|
|
# Find POM and JAR files
|
|
POM_FILE=$(find ./maven-artifacts -name "pom.xml" | head -1)
|
|
JAR_FILE=$(find ./maven-artifacts -name "*.jar" -not -name "*sources*" -not -name "*javadoc*" | head -1)
|
|
|
|
if [ -z "$POM_FILE" ] || [ -z "$JAR_FILE" ]; then
|
|
echo "No artifacts found for ${{ matrix.platform }} - ${{ matrix.implementation }}"
|
|
exit 0
|
|
fi
|
|
|
|
# Extract Maven coordinates from POM
|
|
GROUP_ID=$(grep -o '<groupId>[^<]*</groupId>' "$POM_FILE" | head -1 | sed 's/<[^>]*>//g')
|
|
ARTIFACT_ID=$(grep -o '<artifactId>[^<]*</artifactId>' "$POM_FILE" | head -1 | sed 's/<[^>]*>//g')
|
|
VERSION=$(grep -o '<version>[^<]*</version>' "$POM_FILE" | head -1 | sed 's/<[^>]*>//g')
|
|
|
|
echo "Deploying: $GROUP_ID:$ARTIFACT_ID:$VERSION"
|
|
echo "Platform: ${{ matrix.platform }}, Implementation: ${{ matrix.implementation }}"
|
|
echo "Repository: $REPOSITORY_URL"
|
|
|
|
# Deploy to Maven repository
|
|
mvn deploy:deploy-file \
|
|
-Dfile="$JAR_FILE" \
|
|
-DpomFile="$POM_FILE" \
|
|
-DrepositoryId="$REPOSITORY_ID" \
|
|
-Durl="$REPOSITORY_URL" \
|
|
-DgeneratePom=false \
|
|
-DuniqueVersion=false
|
|
|