Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish desktop apps to Github releases #89

Merged
merged 6 commits into from
Apr 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/desktop_distribution.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Build

on:
# Runs on pushes targeting the default branch
push:
tags:
- '*'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
conveyor:
name: "Create desktop distributions"
environment: production
runs-on: ubuntu-22.04
env:
CONVEYOR_AGREE_TO_LICENSE: "1"
APP_VERSION: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- run: ./gradlew jar

- uses: hydraulic-software/conveyor/actions/build@v1
with:
command: make site
signing_key: ${{ secrets.SIGNING_KEY }}
agree_to_license: 1
conveyor_version: "8.0"
cache_key: conveyor-${{ matrix.os }}-${{ matrix.arch }}

- uses: actions/upload-artifact@v3
with:
name: download-page
path: output
retention-days: 1

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: [conveyor]
steps:
- name: Download a single artifact
uses: actions/download-artifact@v3
with:
name: download-page
path: download
- run: mv download/download.html download/index.html
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ jobs:
image: fmasa/lebeda:7.4-ci
steps:
- run: "true"
- run: echo "SUPPLY_VERSION_CODE=$((950 + $GITHUB_RUN_NUMBER))" >> $GITHUB_ENV
- run: echo "SUPPLY_VERSION_NAME=$(.github/workflows/version.sh)" >> $GITHUB_ENV

build-bundle:
name: Build release bundle
Expand All @@ -96,8 +98,6 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- run: echo "$KEYSTORE_FILE_BASE64" | base64 -d > app/.keystore
- run: echo "SUPPLY_VERSION_CODE=$((950 + $GITHUB_RUN_NUMBER))" >> $GITHUB_ENV
- run: echo "SUPPLY_VERSION_NAME=$(.github/workflows/version.sh)" >> $GITHUB_ENV
- run: 'echo "version code: $SUPPLY_VERSION_CODE, version name: $SUPPLY_VERSION_NAME"'
- run: ./gradlew bundleRelease
- run: mv app/build/outputs/bundle/release/app-release.aab .
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ firebase-debug.log
firebase-build
ui-debug.log
play-store.json
output
65 changes: 9 additions & 56 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,8 @@ android {
jvmTarget = "1.8"
freeCompilerArgs = freeCompilerArgs +
"-Xskip-prerelease-check" +
"-Xopt-in=androidx.compose.foundation.layout.ExperimentalLayout" +
"-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi" +
"-Xopt-in=androidx.compose.material.ExperimentalMaterialApi" +
"-Xopt-in=androidx.compose.animation.ExperimentalAnimationApi" +
"-Xopt-in=androidx.compose.animation.ExperimentalFoundationApi" +
"-Xopt-in=androidx.compose.foundation.ExperimentalFoundationApi" +
"-Xopt-in=kotlinx.serialization.ExperimentalSerializationApi" +
"-Xopt-in=com.google.accompanist.permissions.ExperimentalPermissionsApi" +
"-P" +
"plugin:androidx.compose.compiler.plugins.kotlin:suppressKotlinVersionCompatibilityCheck=true"
}
Expand All @@ -97,61 +91,20 @@ dependencies {
implementation(project(":common"))
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
// Allow use of Java 8 APIs on older Android versions
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")

// Permission management
implementation("com.google.accompanist:accompanist-permissions:0.20.0")

// QR code scanning
implementation("com.google.zxing:core:3.3.3")
implementation("androidx.camera:camera-camera2:1.1.0-alpha02")
implementation("androidx.camera:camera-core:1.1.0-alpha02")
implementation("androidx.camera:camera-lifecycle:1.1.0-alpha02")
implementation("androidx.camera:camera-view:1.0.0-alpha22")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.2.2")

// Testing utilities
testImplementation("junit:junit:4.13.1")
androidTestImplementation("androidx.test.ext:junit:1.1.2")
androidTestImplementation("androidx.test.espresso:espresso-core:3.3.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
testImplementation("org.mockito:mockito-core:2.7.22")

// Basic Android stuff
api("androidx.core:core-ktx:1.5.0")
api("androidx.fragment:fragment-ktx:1.3.5")

// Jetpack Compose
api("androidx.compose.material:material:${Versions.compose}")
api("androidx.compose.ui:ui-tooling:${Versions.compose}")
api("androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1")

// Firebase-related dependencies
api(platform("com.google.firebase:firebase-bom:28.4.2"))
api("com.google.firebase:firebase-firestore-ktx")
api("com.google.firebase:firebase-analytics-ktx")
api("com.google.firebase:firebase-auth-ktx")
api("com.google.firebase:firebase-dynamic-links-ktx")
api("com.google.firebase:firebase-functions-ktx")
api("androidx.work:work-runtime-ktx:2.7.0")
api("androidx.core:core-ktx:1.9.0")
api("androidx.fragment:fragment-ktx:1.5.6")

// Coroutines
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2")
api("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2")
api("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.3.5")

api("io.arrow-kt:arrow-core:0.10.4")

// Parser combinator library (grammars etc.)
api("com.github.h0tk3y.betterParse:better-parse:0.4.2")

// JSON encoding
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.0")

// HTTP Client
val ktorVersion = "1.6.0"
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
implementation("io.ktor:ktor-client-serialization:$ktorVersion")

// Firebase Performance
// implementation("com.google.firebase:firebase-perf-ktx:20.0.1")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
api("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4")
api("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.4")
}
3 changes: 1 addition & 2 deletions app/src/main/kotlin/cz/muni/fi/rpg/ui/WfrpMasterApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import cz.frantisekmasa.wfrp_master.common.shell.DrawerShell
import cz.frantisekmasa.wfrp_master.common.shell.NetworkStatusBanner
import cz.muni.fi.rpg.ui.shell.ProvideDIContainer
import cz.muni.fi.rpg.ui.shell.Startup
import io.ktor.http.Url
import kotlinx.coroutines.launch

@ExperimentalMaterialApi
Expand Down Expand Up @@ -64,7 +63,7 @@ private fun rememberInitialScreens(url: Uri?): List<Screen> {
listOf(PartyListScreen) +
when (url) {
null -> emptyList()
else -> listOf(InvitationLinkScreen(Url(url.toString())))
else -> listOf(InvitationLinkScreen(url.toString()))
}
}
}
10 changes: 1 addition & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
buildscript {
repositories {
google()
mavenCentral()
maven("https://plugins.gradle.org/m2/")
maven("https://kotlin.bintray.com/kotlinx")
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}

dependencies {
classpath("com.android.tools.build:gradle:${Versions.agp}")
classpath("org.jetbrains.compose:compose-gradle-plugin:1.2.2")
classpath("org.jetbrains.compose:compose-gradle-plugin:${Versions.compose}")

classpath(kotlin("gradle-plugin", Versions.kotlin))
classpath(kotlin("serialization", Versions.kotlin))
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/resources/versions.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
androidGradlePluginVersion=7.3.1
kotlinVersion=1.7.20
composeVersion=1.2.1
composeVersion=1.3.1

# Android SDK
androidMinSdk=21
Expand Down
46 changes: 18 additions & 28 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ kotlin {
}

sourceSets {
val koinVersion = "3.1.2"

all {
languageSettings.apply {
optIn("androidx.compose.material.ExperimentalMaterialApi")
Expand All @@ -44,7 +42,6 @@ kotlin {

val voyagerVersion = "1.0.0-rc04"
api("cafe.adriel.voyager:voyager-navigator:$voyagerVersion")
api("cafe.adriel.voyager:voyager-koin:$voyagerVersion")
api("cafe.adriel.voyager:voyager-transitions:$voyagerVersion")

api(project(":common:firebase"))
Expand All @@ -58,8 +55,6 @@ kotlin {
api("org.kodein.di:kodein-di-framework-compose:$kodeinVersion")
implementation("org.kodein.di:kodein-di:$kodeinVersion")

api("io.insert-koin:koin-core:$koinVersion")

implementation("io.arrow-kt:arrow-core:1.0.1")

// Parser combinator library (grammars etc.)
Expand All @@ -69,7 +64,7 @@ kotlin {
implementation("com.benasher44:uuid:0.3.1")

// JSON encoding
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.0")
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")

// Logging
api("io.github.aakira:napier:${Versions.napier}")
Expand All @@ -96,36 +91,31 @@ kotlin {

val androidMain by getting {
dependencies {

// Dependency injection
api("io.insert-koin:koin-android:$koinVersion")

// Permission management
implementation("com.google.accompanist:accompanist-permissions:0.20.0")

api("androidx.activity:activity-compose:1.5.0-alpha03")
api("androidx.activity:activity-compose:1.7.0")

api("androidx.appcompat:appcompat:1.3.1")
api("androidx.core:core-ktx:1.3.1")
api("androidx.appcompat:appcompat:1.6.1")
api("androidx.core:core-ktx:1.9.0")

api("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.3.5")
api("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.4")

implementation("org.kodein.di:kodein-di-framework-android-core:$kodeinVersion")
api("io.insert-koin:koin-android:$koinVersion")

api("androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1")
api("androidx.lifecycle:lifecycle-runtime-ktx:2.4.0")
api("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1")
api("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1")

// Authentication
api("com.google.android.gms:play-services-auth:19.0.0")
implementation("com.google.firebase:firebase-auth-ktx:21.0.1")
implementation("com.google.firebase:firebase-dynamic-links-ktx:21.0.1")
api("com.google.android.gms:play-services-auth:20.4.1")
implementation("com.google.firebase:firebase-auth-ktx:21.2.0")
implementation("com.google.firebase:firebase-dynamic-links-ktx:21.1.0")

// Shared Preferences DataStore
api("androidx.datastore:datastore-preferences:1.0.0")

// Firebase functions
api("com.google.firebase:firebase-functions-ktx:20.0.1")
api("com.google.firebase:firebase-functions-ktx:20.2.2")

implementation("com.tom-roush:pdfbox-android:2.0.27.0")

Expand All @@ -138,14 +128,14 @@ kotlin {
// QR codes
implementation("com.google.zxing:core:3.3.3")

implementation("androidx.camera:camera-camera2:1.1.0-alpha02")
implementation("androidx.camera:camera-core:1.1.0-alpha02")
implementation("androidx.camera:camera-lifecycle:1.1.0-alpha02")
implementation("androidx.camera:camera-view:1.0.0-alpha22")
implementation("androidx.camera:camera-camera2:1.2.2")
implementation("androidx.camera:camera-core:1.2.2")
implementation("androidx.camera:camera-lifecycle:1.2.2")
implementation("androidx.camera:camera-view:1.2.2")

// Network availability check
implementation("com.github.pwittchen:reactivenetwork-rx2:3.0.8")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-rx2:1.4.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-rx2:1.6.4")
}
}

Expand Down Expand Up @@ -202,7 +192,7 @@ android {

dependencies {
// Allow use of Java 8 APIs on older Android versions
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.2.2")
}

compileOptions {
Expand All @@ -221,5 +211,5 @@ android {
}
}
dependencies {
implementation("com.google.firebase:firebase-crashlytics-ktx:18.2.4")
implementation("com.google.firebase:firebase-crashlytics-ktx:18.3.6")
}
18 changes: 9 additions & 9 deletions common/firebase/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@ kotlin {
named("commonMain") {
dependencies {
implementation("io.github.aakira:napier:${Versions.napier}")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0")
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.0")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")
}
}
named("jvmMain") {
dependencies {
api("com.google.cloud:google-cloud-firestore:3.0.18")
api("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.6.0")
api("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.6.4")
}
}
named("androidMain") {
dependencies {
api("com.google.firebase:firebase-auth-ktx:21.0.3")
api("com.google.firebase:firebase-crashlytics-ktx:18.2.9")
api("com.google.firebase:firebase-firestore-ktx:24.1.0")
api("com.google.firebase:firebase-analytics-ktx:20.1.2")
api("com.google.firebase:firebase-functions-ktx:20.0.2")
api("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.0")
api("com.google.firebase:firebase-auth-ktx:21.2.0")
api("com.google.firebase:firebase-crashlytics-ktx:18.3.6")
api("com.google.firebase:firebase-firestore-ktx:24.4.5")
api("com.google.firebase:firebase-analytics-ktx:21.2.1")
api("com.google.firebase:firebase-functions-ktx:20.2.2")
api("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.4")
}
}
}
Expand Down

This file was deleted.

Loading