Skip to content

Commit 52a1477

Browse files
Add GitHub Actions
1 parent a830ce3 commit 52a1477

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '[0-9]+.[0-9]+'
7+
8+
jobs:
9+
release:
10+
name: Publish on Google Play
11+
runs-on: [ self-hosted, macOS ]
12+
timeout-minutes: 45
13+
env:
14+
BUILD_NUMBER: ${{ github.run_number }}
15+
16+
steps:
17+
# Checkout - https://github.com/actions/checkout
18+
- name: Checkout
19+
uses: actions/[email protected]
20+
21+
# Setup Java - https://github.com/actions/setup-java
22+
- name: Set up JDK 21
23+
uses: actions/[email protected]
24+
with:
25+
distribution: 'temurin'
26+
java-version: '21'
27+
- name: Check JDK version
28+
run: java -version
29+
30+
# Setup Android - https://github.com/android-actions/setup-android
31+
- name: Setup Android SDK
32+
uses: android-actions/[email protected]
33+
34+
# Decode Keystore
35+
- name: Decode Keystore
36+
env:
37+
RELEASE_KEYSTORE_BASE64: ${{ secrets.RELEASE_KEYSTORE_BASE64 }}
38+
39+
run: |
40+
echo "$RELEASE_KEYSTORE_BASE64" | base64 --decode > release.jks
41+
42+
# Gradlew Bundle Release
43+
- name: build prod
44+
run: ./gradlew app:bundleRelease
45+
env:
46+
RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }}
47+
RELEASE_KEY_PASS: ${{ secrets.RELEASE_KEY_PASS }}
48+
49+
- name: Upload
50+
uses: actions/upload-artifact@v2
51+
with:
52+
name: Build Artifacts
53+
path: app/build/outputs/
54+
55+
# Create GitHub release - https://github.com/softprops/action-gh-release
56+
- name: GitHub Release
57+
uses: softprops/[email protected]
58+
with:
59+
name: Twilight ${{ env.GITHUB_REF_NAME }}
60+
61+
# Set VERSION_INFORMATION
62+
- run: echo "VERSION_INFORMATION=$(${{github.workspace}}/gradlew -q printVersionInformation)" >> $GITHUB_ENV
63+
continue-on-error: true

composeApp/build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,15 @@ android {
9393
sourceSets["main"].res.srcDirs("src/androidMain/res")
9494
sourceSets["main"].resources.srcDirs("src/commonMain/resources")
9595

96+
signingConfigs {
97+
create("release") {
98+
storeFile = file("secrets/release.jks")
99+
storePassword = System.getenv("RELEASE_KEY_PASS")
100+
keyAlias = System.getenv("RELEASE_KEY_ALIAS")
101+
keyPassword = System.getenv("RELEASE_KEY_PASS")
102+
}
103+
}
104+
96105
defaultConfig {
97106
applicationId = "com.delacrixmorgan.twilight.android"
98107
minSdk = libs.versions.android.minSdk.get().toInt()
@@ -120,6 +129,7 @@ android {
120129
buildFeatures {
121130
buildConfig = true
122131
}
132+
123133
dependencies {
124134
debugImplementation(libs.compose.ui.tooling)
125135
}

0 commit comments

Comments
 (0)