Skip to content

Commit

Permalink
build: alpha variant as monthlies
Browse files Browse the repository at this point in the history
  • Loading branch information
ignoramous authored Mar 1, 2024
1 parent 6fbc8ed commit a170393
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 28 deletions.
46 changes: 30 additions & 16 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
env:
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHANNEL_ID }}
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
SCHEDULED_BUILD_VARIANT: "assembleWebsiteFullDebug"
SCHEDULED_BUILD_VARIANT: "assembleWebsiteFullAlpha"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 1

Expand All @@ -38,24 +38,24 @@ jobs:
java-version: '17'
distribution: 'temurin'

- name: Alpha keystore
run: |
echo "${{ secrets.ALPHA_KS_ASC }}" > alphaKeystore.jks.asc
gpg -d --passphrase "${{ secrets.ALPHA_KS_PASSPHRASE }}" --batch alphaKeystore.jks.asc > app/rdnsAlpha.jks
wc -wcl alphaKeystore.jks.asc app/rdnsAlpha.jks
- name: Build & notify
if: env.TELEGRAM_CHAT_ID && env.SCHEDULED_BUILD_VARIANT && env.TELEGRAM_TOKEN
run: |
# for now, support just one build variant
for TASK in $SCHEDULED_BUILD_VARIANT; do
./gradlew $TASK
apk_path="$(find . -type f -iname '*.apk' | head -n1)"
echo $apk_path
echo "APKFILE=${apk_path}" >> $GITHUB_ENV
curl https://api.telegram.org/bot$TELEGRAM_TOKEN/sendDocument \
-F chat_id="$TELEGRAM_CHAT_ID" \
-F "caption=Size: $(ls -l --block-size=K "$apk_path" | awk '{ print $5 }')" \
-F parse_mode=HTML \
-F document=@"$apk_path" || true
done
./gradlew $SCHEDULED_BUILD_VARIANT
env:
ALPHA_KS_ALIAS: ${{ vars.ALPHA_KS_ALIAS }}
ALPHA_KS_FILE: ${{ vars.ALPHA_KS_FILE }}
ALPHA_KS_STORE_PASSPHRASE: ${{ secrets.ALPHA_KS_STORE_PASSPHRASE }}
ALPHA_KS_PASSPHRASE: $ {{ secrets.ALPHA_KS_PASSPHRASE }}

# github.com/actions/upload-artifact
- name: Upload
- name: Artifact
uses: actions/upload-artifact@v3
if: success()
with:
Expand All @@ -70,4 +70,18 @@ jobs:
prerelease: true
files: |
${{ env. APKFILE }}
- name: Telegram
run: |
# exit okay on errors
set +e
apk_path="$(find . -type f -iname '*.apk' | head -n1)"
echo $apk_path
echo "APKFILE=${apk_path}" >> $GITHUB_ENV
curl https://api.telegram.org/bot$TELEGRAM_TOKEN/sendDocument \
-F chat_id="$TELEGRAM_CHAT_ID" \
-F "caption=Size: $(ls -l --block-size=K "$apk_path" | awk '{ print $5 }')" \
-F parse_mode=HTML \
-F document=@"$apk_path"
33 changes: 21 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def gitVersion = providers.exec {
try {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
} catch (Exception ex) {
logger.warn("No keys. Release disabled: $ex.message")
logger.info("missing keystore prop: $ex.message")
keystoreProperties['keyAlias'] = ''
keystoreProperties['keyPassword'] = ''
keystoreProperties['storeFile'] = '/dev/null'
Expand All @@ -45,6 +45,13 @@ android {
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
// archive.is/wlwD8
alpha {
keyAlias System.getenv("ALPHA_KS_ALIAS") // rdnsAlpha
keyPassword System.getenv("ALPHA_KS_PASSPHRASE")
storeFile System.getenv("ALPHA_KS_FILE") // rdnsAlpha.jks in app/
storePassword System.getenv("ALPHA_KS_STORE_PASSPHRASE")
}
}

buildTypes {
Expand All @@ -59,9 +66,12 @@ android {
matchingFallbacks = ['debug']
initWith buildTypes.debug
}
nightly {
alpha {
// archive.is/y8uCB
applicationIdSuffix ".alpha"
minifyEnabled true
shrinkResources true
signingConfig signingConfigs.alpha
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Expand Down Expand Up @@ -158,7 +168,7 @@ dependencies {
fullImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3'
fullImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'

// For liveData implementation
// LiveData
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.2'

implementation 'com.google.code.gson:gson:2.10.1'
Expand All @@ -173,7 +183,7 @@ dependencies {
fullImplementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2'
fullImplementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'

// For paging - connection tracker
// Pagers Views
implementation "androidx.paging:paging-runtime-ktx:$paging_version"
fullImplementation 'androidx.fragment:fragment-ktx:1.6.2'
implementation 'com.google.android.material:material:1.11.0'
Expand All @@ -185,35 +195,34 @@ dependencies {
fullImplementation 'com.squareup.retrofit2:retrofit:2.9.0'
fullImplementation 'com.squareup.retrofit2:converter-gson:2.9.0'

// Glide implementation
// Glide
fullImplementation('com.github.bumptech.glide:glide:4.16.0') {
exclude group: 'glide-parent'
}
fullImplementation('com.github.bumptech.glide:okhttp3-integration:4.16.0') {
exclude group: 'glide-parent'
}
// Ref - https://stackoverflow.com/questions/46638056/how-to-use-glidemodule-on-glide-4/46638213#46638213
// Ref: https://stackoverflow.com/a/46638213
kspFull 'com.github.bumptech.glide:compiler:4.15.1'

// Swipe button animation
fullImplementation 'com.facebook.shimmer:shimmer:0.5.0'

// Koin core features
// Koin core
download 'io.insert-koin:koin-core:3.2.0'
implementation 'io.insert-koin:koin-core:3.4.3'
// Koin main features for Android (Scope,ViewModel ...)
// Koin main (Scope, ViewModel ...)
download 'io.insert-koin:koin-android:3.2.0'
implementation 'io.insert-koin:koin-android:3.4.3'

download 'hu.autsoft:krate:2.0.0'
implementation 'hu.autsoft:krate:2.0.0'

// To use only without reflection variants of viewBinding
// viewBinding without reflection
fullImplementation 'com.github.kirich1409:viewbindingpropertydelegate:1.5.9'
fullImplementation 'com.github.kirich1409:viewbindingpropertydelegate-noreflection:1.5.9'

// Tun2socks (https://jitpack.io/#celzero/firestack)
// implementation project(":tun2socks")
// from: https://jitpack.io/#celzero/firestack
download 'com.github.celzero:firestack:72eb7e4898@aar'
implementation 'com.github.celzero:firestack:72eb7e4898@aar'

Expand Down Expand Up @@ -244,7 +253,7 @@ dependencies {

playImplementation 'com.google.android.play:core:1.10.3' // for new version updater

// for encrypted file management
// for encrypting wireguard configuration files
implementation("androidx.security:security-crypto:1.1.0-alpha06")
implementation("androidx.security:security-app-authenticator:1.0.0-alpha03")
androidTestImplementation("androidx.security:security-app-authenticator:1.0.0-alpha03")
Expand Down

0 comments on commit a170393

Please sign in to comment.