Skip to content

Commit

Permalink
⚗️ Experiment with matrix for build
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Colman Lopes <[email protected]>
  • Loading branch information
LeoColman committed Feb 12, 2025
1 parent c5edb60 commit 940813e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/build-debug.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,25 @@ import io.github.typesafegithub.workflows.actions.gradle.GradleBuildAction
import io.github.typesafegithub.workflows.domain.RunnerType
import io.github.typesafegithub.workflows.domain.triggers.PullRequest
import io.github.typesafegithub.workflows.domain.triggers.Push
import io.github.typesafegithub.workflows.dsl.expressions.expr
import io.github.typesafegithub.workflows.dsl.workflow


workflow(
name = "Build Universal Debug APK",
on = listOf(Push(branches = listOf("main")), PullRequest()),
on = listOf(Push(branches = listOf("main", "tweak-gha")), PullRequest()),
sourceFile = __FILE__
) {
job(id = "build", runsOn = RunnerType.UbuntuLatest) {
job(
id = "build",
runsOn = RunnerType.UbuntuLatest,
strategyMatrix = mapOf("variant" to listOf("Fdroid", "Playstore", "Github"))
) {
uses(name = "Set up JDK", action = SetupJava(javaVersion = "17", distribution = SetupJava.Distribution.Adopt))
uses(action = Checkout())
uses(name = "Create Fdroid APK", action = GradleBuildAction(arguments = "assembleFdroidDebug"))
uses(name = "Create Playstore APK", action = GradleBuildAction(arguments = "assemblePlaystoreDebug"))
uses(name = "Create Github APK", action = GradleBuildAction(arguments = "assembleGithubDebug"))
uses(
name = "Builds All APKs",
action = GradleBuildAction(arguments = "assemble${expr { "matrix.variant" }}Debug")
)
}
}
21 changes: 9 additions & 12 deletions .github/workflows/build-debug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
push:
branches:
- 'main'
- 'tweak-gha'
pull_request: {}
jobs:
check_yaml_consistency:
Expand All @@ -26,6 +27,12 @@ jobs:
runs-on: 'ubuntu-latest'
needs:
- 'check_yaml_consistency'
strategy:
matrix:
variant:
- 'Fdroid'
- 'Playstore'
- 'Github'
steps:
- id: 'step-0'
name: 'Set up JDK'
Expand All @@ -36,17 +43,7 @@ jobs:
- id: 'step-1'
uses: 'actions/checkout@v4'
- id: 'step-2'
name: 'Create Fdroid APK'
name: 'Builds All APKs'
uses: 'gradle/gradle-build-action@v3'
with:
arguments: 'assembleFdroidDebug'
- id: 'step-3'
name: 'Create Playstore APK'
uses: 'gradle/gradle-build-action@v3'
with:
arguments: 'assemblePlaystoreDebug'
- id: 'step-4'
name: 'Create Github APK'
uses: 'gradle/gradle-build-action@v3'
with:
arguments: 'assembleGithubDebug'
arguments: 'assemble${{ matrix.variant }}Debug'

0 comments on commit 940813e

Please sign in to comment.