Skip to content

fix ios building and update release workflow #110

fix ios building and update release workflow

fix ios building and update release workflow #110

Workflow file for this run

on:
push:
release:
types: [ created ]
name: Build
permissions:
contents: write
jobs:
build:
name: Build
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
cache: "gradle"
# holy shit thats alot of caching
- name: Cache appAndroid
if: matrix.os == 'ubuntu-latest'
uses: actions/cache@v3
with:
path: appAndroid/build
key: ${{ runner.os }}-appAndroid-${{ hashFiles('appAndroid/**', 'build.gradle.kts', 'gradle.properties', 'gradle/libs.versions.toml') }}
- name: Cache appDesktop
uses: actions/cache@v3
with:
path: appDesktop/build
key: ${{ runner.os }}-appDesktop-${{ hashFiles('appDesktop/**', 'build.gradle.kts', 'gradle.properties', 'gradle/libs.versions.toml') }}
- name: Cache genesisApp
uses: actions/cache@v3
with:
path: genesis/app/build
key: ${{ runner.os }}-genesis-app-${{ hashFiles('genesis/app/**', 'build.gradle.kts', 'gradle.properties', 'gradle/libs.versions.toml') }}
- name: Cache genesisCommon
uses: actions/cache@v3
with:
path: genesis/common/build
key: ${{ runner.os }}-genesis-common-${{ hashFiles('genesis/common/**', 'build.gradle.kts', 'gradle.properties', 'gradle/libs.versions.toml') }}
- name: Setup Android SDK
if: matrix.os == 'ubuntu-latest'
uses: android-actions/setup-android@v3
- name: Install rpm-tools on Linux
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install rpm
- name: Build linux
if: matrix.os == 'ubuntu-latest'
run: |
./gradlew appAndroid:build
./gradlew package
./gradlew --stop
- name: Build Windows
if: matrix.os == 'windows-latest'
run: |
./gradlew :appDesktop:createDistributable
./gradlew :appDesktop:package
./gradlew --stop
cd appDesktop/build/compose/binaries/main/
Compress-Archive -Path app -Destination genesis.zip
- name: Build iOS Release
if: matrix.os == 'macos-latest' && github.event_name == 'release'
run: |
xcrun xcodebuild archive -project appiOS/genesis.xcodeproj -scheme genesis -configuration Release -archivePath "appIos/build/genesis.xcarchive" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
cd appIos/build/genesis.xcarchive/Products
mv Applications Payload
zip -r ../../genesis.ipa Payload
- name: Build iOS Debug
if: matrix.os == 'macos-latest' && github.event_name != 'release'
run: |
xcrun xcodebuild archive -project appiOS/genesis.xcodeproj -scheme genesis -configuration Debug -archivePath "appIos/build/genesis.xcarchive" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
cd appIos/build/genesis.xcarchive/Products
mv Applications Payload
zip -r ../../genesis.ipa Payload
- name: Upload IPA
uses: actions/upload-artifact@v3
if: matrix.os == 'macos-latest'
with:
name: genesis.ipa
path: appIos/build/genesis.ipa
- name: Upload DEB
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: genesis.deb
path: appDesktop/build/compose/binaries/main/deb/*.deb
- name: Upload RPM
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: genesis.rpm
path: appDesktop/build/compose/binaries/main/rpm/*.rpm
- name: Upload ZIP
uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
with:
name: genesis.zip
path: appDesktop/build/compose/binaries/main/genesis.zip
- name: Upload EXE
uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
with:
name: genesis.exe
path: appDesktop/build/compose/binaries/main/exe/*.exe
- name: Upload Release APK
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest' && github.event_name == 'release'
with:
name: genesis.apk
path: appAndroid/build/outputs/apk/release/appAndroid-release-unsigned.apk
- name: Upload Debug APK
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest' && github.event_name != 'release'
with:
name: genesis.apk
path: appAndroid/build/outputs/apk/debug/appAndroid-debug.apk
- name: Release
uses: softprops/action-gh-release@v1
if: github.event_name == 'release'
with:
files: |
appDesktop/build/compose/binaries/main/deb/*.deb
appDesktop/build/compose/binaries/main/genesis.zip
appAndroid/build/outputs/apk/release/appAndroid-release-unsigned.apk
appIos/build/genesis.ipa
- name: Notify Release
if: github.event_name == 'release'
run: |
curl -X POST -H "Authorization: ${{ secrets.PRESHARED_KEY }}" https://genesisapi.loveh.art/api/v0/release
- name: Clean up windows
if: matrix.os == 'windows-latest'
run: |
Remove-Item -Path appDesktop/build/compose/binaries -Recurse -Force
- name: Clean up linux
if: matrix.os == 'ubuntu-latest'
run: |
rm -rf appDesktop/build/compose/binaries
rm -rf appAndroid/build/outputs