-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from matejsemancik/feature/ci-cd
CI/CD
- Loading branch information
Showing
11 changed files
with
117 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Pull Request Check | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
|
||
jobs: | ||
check: | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 10 | ||
steps: | ||
- name: 'Checkout' | ||
uses: actions/checkout@v4 | ||
- name: 'Setup Java' | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '21' | ||
- name: "Setup Gradle" | ||
uses: gradle/actions/setup-gradle@v4 | ||
- name: 'Check' | ||
run: | | ||
./gradlew check |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Build Release Artifacts | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build: | ||
timeout-minutes: 15 # Windows is such a special snowflake 🙂 | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: 'Checkout' | ||
uses: actions/checkout@v4 | ||
- name: 'Setup Java' | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '21' | ||
- name: "Setup Gradle" | ||
uses: gradle/actions/setup-gradle@v4 | ||
- name: 'Build' | ||
env: | ||
DESKTOP_PACKAGE_VERSION: ${{ github.event.release.tag_name }} | ||
run: | | ||
./gradlew packageDistributionForCurrentOS | ||
- name: 'Upload assets' | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
**/build/compose/binaries/main/dmg/* | ||
**/build/compose/binaries/main/deb/* | ||
**/build/compose/binaries/main/msi/* |
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
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
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
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
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
5 changes: 5 additions & 0 deletions
5
shared/src/commonMain/kotlin/dev/matsem/bpm/injection/module/PlatformModule.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package dev.matsem.bpm.injection.module | ||
|
||
import org.koin.core.module.Module | ||
|
||
expect fun platformModule(): Module |
5 changes: 5 additions & 0 deletions
5
shared/src/commonMain/kotlin/dev/matsem/bpm/tooling/Platform.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package dev.matsem.bpm.tooling | ||
|
||
interface Platform { | ||
fun getVersionString(): String | ||
} |
12 changes: 12 additions & 0 deletions
12
shared/src/desktopMain/kotlin/dev/matsem/bpm/injection/module/PlatformModule.desktop.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package dev.matsem.bpm.injection.module | ||
|
||
import dev.matsem.bpm.tool.DesktopPlatform | ||
import dev.matsem.bpm.tooling.Platform | ||
import org.koin.core.module.Module | ||
import org.koin.core.module.dsl.singleOf | ||
import org.koin.dsl.bind | ||
import org.koin.dsl.module | ||
|
||
actual fun platformModule(): Module = module { | ||
singleOf(::DesktopPlatform) bind Platform::class | ||
} |
8 changes: 8 additions & 0 deletions
8
shared/src/desktopMain/kotlin/dev/matsem/bpm/tool/DesktopPlatform.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package dev.matsem.bpm.tool | ||
|
||
import dev.matsem.bpm.tooling.Platform | ||
|
||
internal class DesktopPlatform : Platform { | ||
override fun getVersionString(): String = | ||
System.getProperty("jpackage.app-version")?.takeIf { it.isNotBlank() } ?: "local" | ||
} |