Skip to content

Commit

Permalink
🔖 Prepare automatic releaser
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Colman Lopes <[email protected]>
  • Loading branch information
LeoColman committed Jan 13, 2025
1 parent 8c05739 commit 13bcb37
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 26 deletions.
13 changes: 2 additions & 11 deletions .github/workflows/release.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ 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.Mode.Write
import io.github.typesafegithub.workflows.domain.Permission.Contents
import io.github.typesafegithub.workflows.domain.RunnerType.UbuntuLatest
import io.github.typesafegithub.workflows.domain.triggers.WorkflowDispatch
import io.github.typesafegithub.workflows.domain.triggers.WorkflowDispatch.Input
Expand Down Expand Up @@ -51,17 +49,10 @@ workflow(
),
sourceFile = __FILE__
) {
job(id = "create-apk", runsOn = UbuntuLatest, permissions = mapOf(Contents to Write)) {
run(
name = "Set up Git Identity",
command = """
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
""".trimIndent()
)
job(id = "create-apk", runsOn = UbuntuLatest) {

uses(name = "Set up JDK", action = SetupJava(javaVersion = "17", distribution = SetupJava.Distribution.Adopt))
uses(action = Checkout())
uses(action = Checkout(sshKey = expr { secrets["RELEASE_KEY"]!!}))
uses(name = "reveal-secrets", action = GitSecretAction(gpgPrivateKey = expr { GPG_KEY }))

val versionTypeExpr = expr { github["event.inputs.version_type"]!! }
Expand Down
25 changes: 10 additions & 15 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,38 +34,33 @@ jobs:
run: 'git diff --exit-code ''.github/workflows/release.yaml'''
create-apk:
runs-on: 'ubuntu-latest'
permissions:
contents: 'write'
needs:
- 'check_yaml_consistency'
steps:
- id: 'step-0'
name: 'Set up Git Identity'
run: |-
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
- id: 'step-1'
name: 'Set up JDK'
uses: 'actions/setup-java@v4'
with:
java-version: '17'
distribution: 'adopt'
- id: 'step-2'
- id: 'step-1'
uses: 'actions/checkout@v4'
- id: 'step-3'
with:
ssh-key: '${{ secrets.RELEASE_KEY }}'
- id: 'step-2'
name: 'reveal-secrets'
uses: 'entrostat/git-secret-action@v4'
with:
gpg-private-key: '${{ secrets.GPG_KEY }}'
- id: 'step-4'
- id: 'step-3'
name: 'Run Bump Version Script'
run: 'app/bump_version.main.kts ${{ github.event.inputs.version_type }} ${{ github.event.inputs.changelog }}'
- id: 'step-5'
- id: 'step-4'
name: 'Create APK'
uses: 'gradle/gradle-build-action@v3'
with:
arguments: 'assembleGithubRelease'
- id: 'step-6'
- id: 'step-5'
name: 'Create release'
uses: 'softprops/action-gh-release@v2'
with:
Expand All @@ -78,16 +73,16 @@ jobs:
app/build/outputs/mapping/githubRelease/configuration.txt
app/build/outputs/mapping/githubRelease/seeds.txt
app/build/outputs/mapping/githubRelease/usage.txt
- id: 'step-7'
- id: 'step-6'
name: 'Create Bundle'
uses: 'gradle/gradle-build-action@v3'
with:
arguments: 'clean bundlePlaystoreRelease'
- id: 'step-8'
- id: 'step-7'
uses: 'ruby/setup-ruby@v1'
with:
ruby-version: '3.2.3'
- id: 'step-9'
- id: 'step-8'
name: 'Publish to Playstore'
working-directory: 'fastlane'
run: |-
Expand Down

0 comments on commit 13bcb37

Please sign in to comment.