Nebuchadnezzar #251
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
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle | |
name: Gradle Build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
workflow_dispatch: | |
permissions: | |
contents: write | |
concurrency: | |
group: gradle-${{ github.head_ref || github.ref }} | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
jobs: | |
build-jar: | |
name: jar / ${{ matrix.os }} / ${{ matrix.jdk-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
jdk-version: [ 21 ] | |
os: | |
- ubuntu-latest | |
- windows-latest | |
- macos-13 # Intel OSX | |
- macos-14 # ARM64 OSX | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set Up JDK ${{ matrix.jdk-version }} | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.jdk-version }} | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
add-job-summary: 'on-failure' | |
- name: Gradle Build Jar | |
run: ./gradlew clean assemble -Penv=prod-jar | |
- name: Upload Jar | |
uses: actions/upload-artifact@v4 | |
continue-on-error: true | |
with: | |
name: java-${{ matrix.jdk-version }}-${{ runner.os }}-${{ runner.arch }}-jar | |
path: build/libs/*-fx.jar | |
retention-days: 10 | |
if-no-files-found: error | |
- name: Release Jar | |
if: github.event_name == 'release' | |
env: | |
GH_TOKEN: ${{ github.token }} | |
GH_REPO: ${{ github.repository }} | |
RELEASE_NAME: trinity-${{ runner.os }}-${{ runner.arch }}-java-${{ matrix.jdk-version }} | |
shell: bash | |
run: | | |
mv build/libs/*-no-fx.jar "$RELEASE_NAME-slim.jar" | |
mv build/libs/*-fx.jar "$RELEASE_NAME.jar" | |
if [[ "$RUNNER_OS" == "macOS" ]]; then | |
zip "$RELEASE_NAME-jar.zip" "$RELEASE_NAME.jar" | |
elif [[ "$RUNNER_OS" == "Windows" ]]; then | |
7z a "$RELEASE_NAME-jar.zip" "$RELEASE_NAME.jar" | |
elif [[ "$RUNNER_OS" == "Linux" ]]; then | |
zip "$RELEASE_NAME-jar.zip" "$RELEASE_NAME.jar" | |
zip "trinity-java-${{ matrix.jdk-version }}-slim-jar.zip" "$RELEASE_NAME-slim.jar" | |
gh release upload "${{ github.ref_name }}" "trinity-java-${{ matrix.jdk-version }}-slim-jar.zip" | |
else | |
exit 1 | |
fi | |
gh release upload "${{ github.ref_name }}" "$RELEASE_NAME-jar.zip" | |
build-jlink: | |
name: jlink / ${{ matrix.os }} / ${{ matrix.jdk-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
jdk-version: [ 21 ] | |
os: | |
- ubuntu-latest | |
- windows-latest | |
- macos-13 # Intel OSX | |
- macos-14 # ARM64 OSX | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set Up JDK ${{ matrix.jdk-version }} | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.jdk-version }} | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
add-job-summary: 'on-failure' | |
- name: Gradle Build JLink Zip | |
run: ./gradlew clean jlink -Penv=prod-jlink | |
- name: Upload JLink Zip | |
uses: actions/upload-artifact@v4 | |
continue-on-error: true | |
with: | |
name: java-${{ matrix.jdk-version }}-${{ runner.os }}-${{ runner.arch }}-jlink-zip | |
path: build/image/** | |
retention-days: 10 | |
if-no-files-found: error | |
- name: Release JLink | |
if: github.event_name == 'release' | |
env: | |
GH_TOKEN: ${{ github.token }} | |
GH_REPO: ${{ github.repository }} | |
RELEASE_NAME: trinity-${{ runner.os }}-${{ runner.arch }}-java-${{ matrix.jdk-version }} | |
shell: bash | |
run: | | |
mv "build/image" "build/Trinity" | |
pushd "build" | |
if [[ "$RUNNER_OS" == "macOS" ]]; then | |
zip -r "../$RELEASE_NAME-jlink.zip" "Trinity" | |
elif [[ "$RUNNER_OS" == "Windows" ]]; then | |
7z a "../$RELEASE_NAME-jlink.zip" "Trinity" | |
elif [[ "$RUNNER_OS" == "Linux" ]]; then | |
zip -r ../"$RELEASE_NAME-jlink.zip" "Trinity" | |
else | |
exit 1 | |
fi | |
popd | |
gh release upload "${{ github.ref_name }}" "$RELEASE_NAME-jlink.zip" | |
build-jpackage: | |
name: jpackage / ${{ matrix.os }} / ${{ matrix.jdk-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
jdk-version: [ 21 ] | |
os: | |
- ubuntu-latest | |
- windows-latest | |
- macos-13 # Intel OSX | |
- macos-14 # ARM64 OSX | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set Up JDK ${{ matrix.jdk-version }} | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.jdk-version }} | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
add-job-summary: 'on-failure' | |
- name: Gradle Build JPackage | |
run: ./gradlew clean jpackage -Penv=prod-jlink | |
- name: Upload JPackage | |
uses: actions/upload-artifact@v4 | |
continue-on-error: true | |
with: | |
name: java-${{ matrix.jdk-version }}-${{ runner.os }}-${{ runner.arch }}-jpackage | |
path: build/jpackage/** | |
retention-days: 10 | |
if-no-files-found: error | |
- name: Release JPackage | |
if: github.event_name == 'release' | |
env: | |
GH_TOKEN: ${{ github.token }} | |
GH_REPO: ${{ github.repository }} | |
RELEASE_NAME: trinity-${{ runner.os }}-${{ runner.arch }}-java-${{ matrix.jdk-version }} | |
shell: bash | |
run: | | |
if [[ "$RUNNER_OS" == "macOS" ]]; then | |
mv build/jpackage/Trinity.app "Trinity.app" | |
zip -r "$RELEASE_NAME-jpackage.zip" "Trinity.app" | |
elif [[ "$RUNNER_OS" == "Windows" ]]; then | |
mv build/jpackage/** . | |
7z a "$RELEASE_NAME-jpackage.zip" "Trinity" | |
elif [[ "$RUNNER_OS" == "Linux" ]]; then | |
mv build/jpackage/** . | |
zip -r "$RELEASE_NAME-jpackage.zip" "Trinity/bin" "Trinity/lib" | |
else | |
exit 1 | |
fi | |
gh release upload "${{ github.ref_name }}" "$RELEASE_NAME-jpackage.zip" |