Skip to content

Commit c68065b

Browse files
committed
Add release.yml for releasing straight from Github from a tag push
Include the release version in the apk filename
1 parent 42a7c77 commit c68065b

File tree

2 files changed

+87
-2
lines changed

2 files changed

+87
-2
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: Create Release on Tag
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Set up JDK 17
16+
uses: actions/setup-java@v4
17+
with:
18+
distribution: 'temurin'
19+
java-version: '17'
20+
21+
- name: google-services.json and extra strings file
22+
env:
23+
GOOGLE_SERVICES_BASE64: ${{secrets.GOOGLE_SERVICES_BASE64}}
24+
STRINGS_OTHER_BASE64: ${{secrets.STRINGS_OTHER}}
25+
run: |
26+
echo $GOOGLE_SERVICES_BASE64 | base64 --decode > ./app/google-services.json
27+
echo $STRINGS_OTHER_BASE64 | base64 --decode > ./app/src/main/res/values/strings_other.xml
28+
29+
- name: Decode Keystore
30+
env:
31+
KEYSTORE_BASE64: ${{ secrets.RELEASE_KEYSTORE_BASE64 }}
32+
run: |
33+
echo "$KEYSTORE_BASE64" | base64 --decode > release-keystore.jks
34+
35+
- name: Build signed APK
36+
env:
37+
RELEASE_KEYSTORE_PATH: ${{ github.workspace }}/release-keystore.jks
38+
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }}
39+
RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }}
40+
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
41+
run: ./gradlew assembleRelease
42+
43+
- name: Create Release
44+
id: create_release
45+
uses: actions/create-release@v1
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
tag_name: ${{ github.ref_name }}
50+
release_name: Release ${{ github.ref_name }}
51+
draft: false
52+
prerelease: false
53+
54+
- name: Upload APK Asset
55+
uses: actions/upload-release-asset@v1
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
with:
59+
upload_url: ${{ steps.create_release.outputs.upload_url }}
60+
asset_path: app/release/ImmichTV-${{ github.ref_name }}.apk
61+
asset_name: ImmichTV-${{ github.ref_name }}.apk
62+
asset_content_type: application/vnd.android.package-archive
63+

app/build.gradle

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,34 @@ android {
3030
applicationId "nl.giejay.android.tv.immich"
3131
minSdkVersion 24
3232
targetSdkVersion 35
33-
versionCode 96
34-
versionName "3.8.3"
33+
versionCode 97
34+
versionName "3.9.0"
3535

3636
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3737
testOptions.unitTests.includeAndroidResources = true
3838
}
3939

40+
signingConfigs {
41+
release {
42+
storeFile file(System.getenv("RELEASE_KEYSTORE_PATH") ?: "keystore")
43+
storePassword System.getenv("RELEASE_KEYSTORE_PASSWORD") ?: "dummy"
44+
keyAlias System.getenv("RELEASE_KEY_ALIAS") ?: "dummy"
45+
keyPassword System.getenv("RELEASE_KEY_PASSWORD") ?: "dummy"
46+
}
47+
}
48+
4049
buildTypes {
4150
release {
4251
minifyEnabled false
4352
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
53+
signingConfig signingConfigs.release
4454
}
4555
}
4656

57+
lint {
58+
disable "NullSafeMutableLiveData"
59+
}
60+
4761
buildFeatures {
4862
// View binding allows efficient, type-safe view access
4963
// See more at https://developer.android.com/topic/libraries/view-binding
@@ -58,6 +72,14 @@ android {
5872
targetCompatibility JavaVersion.VERSION_17
5973
}
6074

75+
applicationVariants.all { variant ->
76+
variant.outputs.all { output ->
77+
def appName = "ImmichTV" // Change if needed
78+
def versionName = variant.versionName
79+
outputFileName = "${appName}-${versionName}.apk"
80+
}
81+
}
82+
6183
kotlinOptions {
6284
jvmTarget = "17"
6385
}

0 commit comments

Comments
 (0)