release #97
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: release | |
on: | |
workflow_dispatch: | |
# Inputs the workflow accepts. | |
inputs: | |
version: | |
# Friendly description to be shown in the UI instead of 'name' | |
description: 'Version' | |
# Default value if no value is explicitly provided | |
default: '1.0.0' | |
# Input has to be provided for the workflow to run | |
required: true | |
build-for-windows: | |
type: boolean | |
default: true | |
build-for-linux: | |
type: boolean | |
default: true | |
build-for-mac: | |
type: boolean | |
default: true | |
build-for-android: | |
type: boolean | |
default: true | |
build-for-ios: | |
type: boolean | |
default: true | |
permissions: write-all | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ github.event.inputs.version }} | |
generateReleaseNotes: true | |
build-windows: | |
runs-on: windows-latest | |
if: ${{ github.event.inputs.build-for-windows == 'true' }} | |
needs: release | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- uses: graalvm/setup-graalvm@v1 | |
with: | |
version: 'latest' | |
java-version: '17' | |
components: 'native-image' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build | |
continue-on-error: true | |
shell: pwsh | |
# Also sets path for candle and light | |
run: | | |
echo "C:\Program Files (x86)\WiX Toolset v3.11\bin" >> $GITHUB_PATH | |
./gradlew clean shadowJar desktop:packageForWindows --stacktrace --info --no-daemon -x test | |
cd ./desktop | |
echo "Contents of ./build folder:" | |
Get-ChildItem -Path "./build" -Recurse | |
echo "Building Native-Image..." | |
cd ./build | |
native-image -jar ./libs/Desku-App.jar Desku-App-windows-runnable | |
- name: Upload binaries to release | |
uses: svenstaro/[email protected] | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ./desktop/build/*.* | |
tag: ${{ github.event.inputs.version }} | |
overwrite: true | |
file_glob: true | |
build-mac: | |
runs-on: macos-latest | |
if: ${{ github.event.inputs.build-for-mac == 'true' }} | |
needs: release | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- uses: graalvm/setup-graalvm@v1 | |
with: | |
version: 'latest' | |
java-version: '17' | |
components: 'native-image' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build | |
continue-on-error: true | |
run: | | |
sudo chmod +x gradlew | |
./gradlew clean shadowJar desktop:packageForMac --stacktrace --info --no-daemon -x test | |
cd ./desktop | |
echo "Contents of ./build folder:" | |
find ./build | |
echo "Building Native-Image..." | |
cd ./build | |
native-image -jar ./libs/Desku-App.jar Desku-App-mac-runnable | |
- name: Upload binaries to release | |
uses: svenstaro/[email protected] | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ./desktop/build/*.* | |
tag: ${{ github.event.inputs.version }} | |
overwrite: true | |
file_glob: true | |
build-linux: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.inputs.build-for-linux == 'true' }} | |
needs: release | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- uses: graalvm/setup-graalvm@v1 | |
with: | |
version: 'latest' | |
java-version: '17' | |
components: 'native-image' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build | |
continue-on-error: true | |
run: | | |
echo "GRAALVM_HOME: $GRAALVM_HOME" | |
echo "JAVA_HOME: $JAVA_HOME" | |
sudo chmod +x gradlew | |
./gradlew clean shadowJar desktop:packageForLinux --stacktrace --info --no-daemon -x test | |
cd ./desktop | |
echo "Contents of ./build folder:" | |
find ./build | |
echo "Building Native-Image..." | |
cd ./build | |
native-image -jar ./libs/Desku-App.jar Desku-App-linux-runnable | |
- name: Upload binaries to release | |
uses: svenstaro/[email protected] | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ./desktop/build/*.* | |
tag: ${{ github.event.inputs.version }} | |
overwrite: true | |
file_glob: true | |
build-android: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.inputs.build-for-android == 'true' }} | |
needs: release | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- uses: graalvm/setup-graalvm@v1 | |
with: | |
version: 'latest' | |
java-version: '17' | |
components: 'native-image' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v2 | |
- name: Build | |
continue-on-error: true | |
# Release singing: | |
# https://developer.android.com/studio/publish/app-signing | |
# https://medium.com/google-developer-experts/github-actions-for-android-developers-6b54c8a32f55 | |
run: | | |
echo "GRAALVM_HOME: $GRAALVM_HOME" | |
echo "JAVA_HOME: $JAVA_HOME" | |
chmod +x gradlew | |
export ANDROID_HOME=$HOME/.android/sdk | |
keytool -genkey -v -keystore ~/.android/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US" | |
./gradlew clean shadowJar android:build --stacktrace --info --no-daemon -x test | |
cd ./android | |
echo "Contents of ./build folder:" | |
find ./build | |
#echo "Building Native-Image..." | |
#cd ./build | |
#native-image -jar ./libs/Desku-App.jar Desku-App-android-runnable | |
- name: Upload binaries to release | |
uses: svenstaro/[email protected] | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: | | |
./android/build/outputs/apk/debug/*.* | |
./android/build/outputs/apk/release/*.* | |
tag: ${{ github.event.inputs.version }} | |
overwrite: true | |
file_glob: true | |
build-ios: | |
runs-on: macos-latest | |
if: ${{ github.event.inputs.build-for-ios == 'true' }} | |
needs: release | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- uses: graalvm/setup-graalvm@v1 | |
with: | |
version: 'latest' | |
java-version: '17' | |
components: 'native-image' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build | |
continue-on-error: true | |
# If you want to release a signed .ipa follow these steps: | |
# https://stackoverflow.com/questions/25133774/robovm-missing-signing-identity | |
run: | | |
echo "GRAALVM_HOME: $GRAALVM_HOME" | |
echo "JAVA_HOME: $JAVA_HOME" | |
sudo chmod +x gradlew | |
./gradlew clean shadowJar ios:build ios:robovmArchive --stacktrace --info --no-daemon -x test | |
cd ./ios | |
echo "Contents of ./build folder:" | |
find ./build | |
#echo "Building Native-Image..." | |
#cd ./build | |
#native-image -jar ./libs/Desku-App.jar Desku-App-ios-runnable | |
- name: Upload binaries to release | |
uses: svenstaro/[email protected] | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: | | |
./ios/build/robovm/*.* | |
tag: ${{ github.event.inputs.version }} | |
overwrite: true | |
file_glob: true | |