-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
release.main.kts
executable file
·65 lines (55 loc) · 2.61 KB
/
release.main.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env kotlin
@file:Repository("https://repo1.maven.org/maven2/")
@file:DependsOn("io.github.typesafegithub:github-workflows-kt:3.0.1")
@file:Repository("https://bindings.krzeminski.it")
@file:DependsOn("actions:checkout:v4")
@file:DependsOn("actions:setup-java:v4")
@file:DependsOn("gradle:gradle-build-action:v3")
@file:DependsOn("entrostat:git-secret-action:v4")
@file:DependsOn("ruby:setup-ruby:v1")
@file:DependsOn("softprops:action-gh-release:v2")
import io.github.typesafegithub.workflows.actions.actions.Checkout
import io.github.typesafegithub.workflows.actions.actions.SetupJava
import io.github.typesafegithub.workflows.actions.entrostat.GitSecretAction
import io.github.typesafegithub.workflows.actions.gradle.GradleBuildAction
import io.github.typesafegithub.workflows.actions.ruby.SetupRuby
import io.github.typesafegithub.workflows.actions.softprops.ActionGhRelease
import io.github.typesafegithub.workflows.domain.RunnerType.UbuntuLatest
import io.github.typesafegithub.workflows.domain.triggers.Push
import io.github.typesafegithub.workflows.dsl.expressions.Contexts
import io.github.typesafegithub.workflows.dsl.expressions.expr
import io.github.typesafegithub.workflows.dsl.workflow
val GPG_KEY by Contexts.secrets
val GITHUB_REF_NAME by Contexts.github
workflow(
name = "Release",
on = listOf(Push(tags = listOf("*"))),
sourceFile = __FILE__
) {
job(id = "create-apk", runsOn = UbuntuLatest) {
uses(name = "Set up JDK", action = SetupJava(javaVersion = "17", distribution = SetupJava.Distribution.Adopt))
uses(action = Checkout())
uses(name = "reveal-secrets", action = GitSecretAction(gpgPrivateKey = expr { GPG_KEY }))
uses(name = "Create APK", action = GradleBuildAction(arguments = "assembleGithubRelease"))
uses(
name = "Create release", action = ActionGhRelease(
tagName = expr { GITHUB_REF_NAME },
name = expr { GITHUB_REF_NAME },
draft = false,
files = listOf(
"app/build/outputs/apk/github/release/app-github-release.apk",
"app/build/outputs/mapping/githubRelease/mapping.txt",
"app/build/outputs/mapping/githubRelease/configuration.txt",
"app/build/outputs/mapping/githubRelease/seeds.txt",
"app/build/outputs/mapping/githubRelease/usage.txt",
)
)
)
uses(name = "Create Bundle", action = GradleBuildAction(arguments = "clean bundlePlaystoreRelease"))
uses(action = SetupRuby(rubyVersion = "3.2.3"))
run(
name = "publish-playstore",
command = "bundle config path vendor/bundle && bundle install --jobs 4 --retry 3 && bundle exec fastlane playstore"
)
}
}