Build #56 #56
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: Build | |
run-name: "Build #${{ github.run_number }}" | |
on: | |
push: | |
tags: | |
- 'v*' | |
branches: | |
- main | |
paths-ignore: | |
- '*.md' | |
pull_request: | |
paths-ignore: | |
- '*.md' | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-native: | |
name: Build Native | |
strategy: | |
matrix: | |
os: [ macos-11, windows-latest, ubuntu-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Install Ubuntu Deps | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt install -y libcurl4-openssl-dev | |
- name: 📦 Build Native Binary | |
uses: burrunan/gradle-cache-action@v1 | |
with: | |
gradle-version: wrapper | |
job-id: ${{ matrix.os }} | |
arguments: linkReleaseExecutableNative | |
properties: | | |
org.gradle.vfs.watch=false | |
org.gradle.vfs.verbose=false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Rename Native Binary Linux | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
cd build/bin/native/releaseExecutable | |
mv pakku.kexe pakku | |
- name: Rename Native Binary macOS | |
if: matrix.os == 'macos-11' | |
run: | | |
cd build/bin/native/releaseExecutable | |
mv pakku.kexe pakku-macos | |
- name: Upload Native Binary | |
uses: actions/upload-artifact@v4 | |
with: | |
name: native-package-${{ runner.os }} | |
path: | | |
build/bin/native/releaseExecutable/pakku | |
build/bin/native/releaseExecutable/pakku-macos | |
build/bin/native/releaseExecutable/pakku.exe | |
build-jvm: | |
name: Build JVM | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: 📦 Build JVM | |
uses: burrunan/gradle-cache-action@v1 | |
with: | |
gradle-version: wrapper | |
arguments: jvmJar | |
properties: | | |
org.gradle.vfs.watch=false | |
org.gradle.vfs.verbose=false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload JVM | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jvm-package | |
path: build/libs/pakku.jar | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: [build-native, build-jvm] | |
permissions: | |
contents: write | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- name: Download Artifact Linux | |
uses: actions/download-artifact@v4 | |
with: | |
name: native-package-Linux | |
path: package | |
- name: Download Artifact macOS | |
uses: actions/download-artifact@v4 | |
with: | |
name: native-package-macOS | |
path: package | |
- name: Download Artifact Windows | |
uses: actions/download-artifact@v4 | |
with: | |
name: native-package-Windows | |
path: package | |
- name: Download Artifact JVM | |
uses: actions/download-artifact@v4 | |
with: | |
name: jvm-package | |
path: package | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
prerelease: true | |
generate_release_notes: true | |
files: | | |
package/pakku | |
package/pakku-macos | |
package/pakku.exe | |
package/pakku.jar | |
env: | |
GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=true -Dkotlin.incremental=false -Dorg.gradle.project.kotlin.incremental.multiplatform=false -Dorg.gradle.project.kotlin.native.disableCompilerDaemon=true -Dorg.gradle.jvmargs="-Xmx5g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" |