From 12b83f650f32e19b117466744fec3e0829c94c39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Hrivn=C3=A1k?= Date: Sat, 4 May 2024 15:18:55 +0200 Subject: [PATCH] Add distributions to build workflow --- .github/workflows/Build.yml | 107 ++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 55 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 34a47fbe..c1c571b8 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -15,60 +15,6 @@ on: - '*.md' 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 @@ -90,6 +36,7 @@ jobs: properties: | org.gradle.vfs.watch=false org.gradle.vfs.verbose=false + gradle-distribution-sha-256-sum-warning: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -99,10 +46,52 @@ jobs: name: jvm-package path: build/libs/pakku.jar + build-jvm-dist: + name: Build JVM Distributions + 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 distZip + uses: burrunan/gradle-cache-action@v1 + with: + gradle-version: wrapper + arguments: distZip + properties: | + org.gradle.vfs.watch=false + org.gradle.vfs.verbose=false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: 📦 Build JVM distTar + uses: burrunan/gradle-cache-action@v1 + with: + gradle-version: wrapper + arguments: distTar + properties: | + org.gradle.vfs.watch=false + org.gradle.vfs.verbose=false + gradle-distribution-sha-256-sum-warning: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload JVM Distributions + uses: actions/upload-artifact@v4 + with: + name: jvm-dist + path: build/distributions/ + release: name: Release runs-on: ubuntu-latest - needs: [build-jvm] + needs: [build-jvm, build-jvm-dist] permissions: contents: write if: startsWith(github.ref, 'refs/tags/v') @@ -113,12 +102,20 @@ jobs: name: jvm-package path: package + - name: Download Artifact JVM Distributions + uses: actions/download-artifact@v4 + with: + name: jvm-dist + path: dist + - name: Create release uses: softprops/action-gh-release@v1 with: prerelease: false files: | package/pakku.jar + dist/*.zip + dist/*.tar 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"