Release v0.8.3 #31
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'jHDF Release' | |
on: | |
# When a release is created | |
release: | |
types: | |
- created | |
# Manual | |
workflow_dispatch: | |
jobs: | |
# First run all builds to verify | |
build: | |
name: "Build all platforms" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ 'macos-latest', 'ubuntu-latest', 'windows-latest', ['self-hosted', 'ARM64'] ] | |
java: [ '8', '11', '17', '21' ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: 'zulu' | |
- name: Gradle Build | |
working-directory: jhdf | |
run: ./gradlew build | |
- name: Gradle Build Jars | |
working-directory: jhdf | |
run: ./gradlew jar sourcesJar javadocJar | |
release: | |
name: "Publish Release" | |
needs: build # If all builds completed successfully | |
runs-on: ubuntu-latest | |
environment: Release # Access environment with release keys | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
# Must use the lowest supported Java version | |
java-version: '8' | |
distribution: 'temurin' | |
- name: Build | |
working-directory: jhdf | |
run: ./gradlew assemble | |
- name: Gradle Build Jars | |
working-directory: jhdf | |
run: ./gradlew jar sourcesJar javadocJar | |
# Tests signing and ensure archived artifacts include signatures | |
- name: Sign Publication | |
env: | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
working-directory: jhdf | |
run: ./gradlew signMavenPublication | |
- name: Archive Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts | |
path: | | |
jhdf/build/libs | |
jhdf/build/publications | |
- name: Publish to GitHub Packages | |
working-directory: jhdf | |
env: | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: ./gradlew publishMavenPublicationToGitHubRepository | |
- name: Publish to Sonatype (Maven Central) | |
working-directory: jhdf | |
env: | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
run: ./gradlew publishMavenPublicationToSonatypeRepository |