Skip to content

Commit

Permalink
Add distributions to build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
juraj-hrivnak committed May 4, 2024
1 parent 856a2b2 commit 12b83f6
Showing 1 changed file with 52 additions and 55 deletions.
107 changes: 52 additions & 55 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}

Expand All @@ -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')
Expand All @@ -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"

0 comments on commit 12b83f6

Please sign in to comment.