Add signing config
This commit is contained in:
parent
d404f93e88
commit
a724630ced
3 changed files with 11 additions and 43 deletions
|
@ -1,42 +0,0 @@
|
||||||
name: Android Signed Build and Release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: https://source.mapcomplete.org/actions/checkout@v4
|
|
||||||
-
|
|
||||||
uses: https://source.mapcomplete.org/actions/setup-android@v3.2.2
|
|
||||||
|
|
||||||
- name: Decode keystore
|
|
||||||
run: |
|
|
||||||
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > my-release-key.jks
|
|
||||||
|
|
||||||
- name: Set up gradle properties
|
|
||||||
run: |
|
|
||||||
mkdir -p ~/.gradle
|
|
||||||
echo "storeFile=my-release-key.jks" >> ~/.gradle/gradle.properties
|
|
||||||
echo "storePassword=${{ secrets.KEYSTORE_PASSWORD }}" >> ~/.gradle/gradle.properties
|
|
||||||
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> ~/.gradle/gradle.properties
|
|
||||||
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> ~/.gradle/gradle.properties
|
|
||||||
|
|
||||||
- name: Grant execute permission to gradlew
|
|
||||||
run: chmod +x ./gradlew
|
|
||||||
|
|
||||||
- name: Build signed APK
|
|
||||||
run: |
|
|
||||||
export ANDROID_SDK_HOME=/home/runner/.android/sdk/
|
|
||||||
export PATH=$ANDROID_SDK_HOME/tools:$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/:$ANDROID_SDK_HOME/cmdline-tools/latest/tools/bin:$PATH
|
|
||||||
./gradlew assembleRelease
|
|
||||||
|
|
||||||
- name: Upload APK to Release
|
|
||||||
uses: https://code.forgejo.org/actions/forgejo-release@v2
|
|
||||||
with:
|
|
||||||
files: app/build/outputs/apk/release/*.apk
|
|
||||||
env:
|
|
||||||
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
|
|
|
@ -16,10 +16,20 @@ android {
|
||||||
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
|
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile file(System.getProperty("user.home") + "/.gradle/my-release-key.jks")
|
||||||
|
storePassword System.getenv("KEYSTORE_PASSWORD")
|
||||||
|
keyAlias System.getenv("KEY_ALIAS")
|
||||||
|
keyPassword System.getenv("KEY_PASSWORD")
|
||||||
|
}
|
||||||
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
shrinkResources false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class MainActivity extends BridgeActivity {
|
||||||
// We got a request - open the browser on 'app.mapcomplete.org/land' to login in the browser, then pass the token along
|
// We got a request - open the browser on 'app.mapcomplete.org/land' to login in the browser, then pass the token along
|
||||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://app.mapcomplete.org/land.html"));
|
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://app.mapcomplete.org/land.html"));
|
||||||
startActivity(browserIntent);
|
startActivity(browserIntent);
|
||||||
pluginCall.resolve(); // We simply resolve without anythin
|
pluginCall.resolve(); // We simply resolve without anything
|
||||||
});
|
});
|
||||||
Databridge.addResponder("request:login", pluginCall -> {
|
Databridge.addResponder("request:login", pluginCall -> {
|
||||||
// We got a request - open the browser on 'app.mapcomplete.org/land' to login in the browser, then pass the token along
|
// We got a request - open the browser on 'app.mapcomplete.org/land' to login in the browser, then pass the token along
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue