mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-08 00:51:20 +00:00
test bundle packaging
This commit is contained in:
parent
7ad061ff70
commit
1e0215b9fd
97
.drone.yml
97
.drone.yml
|
@ -23,6 +23,10 @@ steps:
|
||||||
commands:
|
commands:
|
||||||
- ./ci.py --ci-build-apk
|
- ./ci.py --ci-build-apk
|
||||||
|
|
||||||
|
- name: Build Bundle Target
|
||||||
|
commands:
|
||||||
|
- ./ci.py --ci-build-bundle
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
|
@ -45,59 +49,70 @@ steps:
|
||||||
- git config user.email "builder@selfprivacy.org"
|
- git config user.email "builder@selfprivacy.org"
|
||||||
- git config user.name "Builder"
|
- git config user.name "Builder"
|
||||||
|
|
||||||
- name: Build Intermediate Linux Release Artifact (Binary)
|
# - name: Build Intermediate Linux Release Artifact (Binary)
|
||||||
|
# commands:
|
||||||
|
# - ./ci.py --build-linux
|
||||||
|
# environment:
|
||||||
|
# STANDALONE_KEYSTORE_PASS:
|
||||||
|
# from_secret: STANDALONE_KEYSTORE_PASS
|
||||||
|
# FDROID_KEYSTORE_PASS:
|
||||||
|
# from_secret: FDROID_KEYSTORE_PASS
|
||||||
|
|
||||||
|
# - name: Build Intermediate Android Release Artifact (.APK)
|
||||||
|
# commands:
|
||||||
|
# - ./ci.py --build-apk
|
||||||
|
# environment:
|
||||||
|
# STANDALONE_KEYSTORE_PASS:
|
||||||
|
# from_secret: STANDALONE_KEYSTORE_PASS
|
||||||
|
# FDROID_KEYSTORE_PASS:
|
||||||
|
# from_secret: FDROID_KEYSTORE_PASS
|
||||||
|
|
||||||
|
- name: Build and Sign Android Release Artifact (Bundle)
|
||||||
commands:
|
commands:
|
||||||
- ./ci.py --build-linux
|
- ./ci.py --build-bundle
|
||||||
environment:
|
environment:
|
||||||
STANDALONE_KEYSTORE_PASS:
|
STANDALONE_KEYSTORE_PASS:
|
||||||
from_secret: STANDALONE_KEYSTORE_PASS
|
from_secret: STANDALONE_KEYSTORE_PASS
|
||||||
FDROID_KEYSTORE_PASS:
|
FDROID_KEYSTORE_PASS:
|
||||||
from_secret: FDROID_KEYSTORE_PASS
|
from_secret: FDROID_KEYSTORE_PASS
|
||||||
|
GOOGLE_KEYSTORE_CONF:
|
||||||
|
from_secret: GOOGLE_KEYSTORE_CONF
|
||||||
|
|
||||||
- name: Build Intermediate Android Release Artifact (.APK)
|
# - name: Sign Android Release Artifact (.APK) for Standalone Use
|
||||||
commands:
|
# commands:
|
||||||
- ./ci.py --build-apk
|
# - ./ci.py --sign-apk-standalone
|
||||||
environment:
|
# environment:
|
||||||
STANDALONE_KEYSTORE_PASS:
|
# STANDALONE_KEYSTORE_PASS:
|
||||||
from_secret: STANDALONE_KEYSTORE_PASS
|
# from_secret: STANDALONE_KEYSTORE_PASS
|
||||||
FDROID_KEYSTORE_PASS:
|
# FDROID_KEYSTORE_PASS:
|
||||||
from_secret: FDROID_KEYSTORE_PASS
|
# from_secret: FDROID_KEYSTORE_PASS
|
||||||
|
|
||||||
- name: Sign Android Release Artifact (.APK) for Standalone Use
|
# - name: Sign Android Release Artifact (.APK) for F-Droid Repository
|
||||||
commands:
|
# commands:
|
||||||
- ./ci.py --sign-apk-standalone
|
# - ./ci.py --sign-apk-fdroid
|
||||||
environment:
|
# environment:
|
||||||
STANDALONE_KEYSTORE_PASS:
|
# STANDALONE_KEYSTORE_PASS:
|
||||||
from_secret: STANDALONE_KEYSTORE_PASS
|
# from_secret: STANDALONE_KEYSTORE_PASS
|
||||||
FDROID_KEYSTORE_PASS:
|
# FDROID_KEYSTORE_PASS:
|
||||||
from_secret: FDROID_KEYSTORE_PASS
|
# from_secret: FDROID_KEYSTORE_PASS
|
||||||
|
|
||||||
- name: Sign Android Release Artifact (.APK) for F-Droid Repository
|
# - name: Package Linux AppImage Artifact
|
||||||
commands:
|
# commands:
|
||||||
- ./ci.py --sign-apk-fdroid
|
# - ./ci.py --package-linux-appimage
|
||||||
environment:
|
|
||||||
STANDALONE_KEYSTORE_PASS:
|
|
||||||
from_secret: STANDALONE_KEYSTORE_PASS
|
|
||||||
FDROID_KEYSTORE_PASS:
|
|
||||||
from_secret: FDROID_KEYSTORE_PASS
|
|
||||||
|
|
||||||
- name: Package Linux AppImage Artifact
|
# - name: Package Linux Flatpak Artifact
|
||||||
commands:
|
# commands:
|
||||||
- ./ci.py --package-linux-appimage
|
# - ./ci.py --package-linux-flatpak
|
||||||
|
|
||||||
- name: Package Linux Flatpak Artifact
|
# - name: Package Linux Archive Artifact
|
||||||
commands:
|
# commands:
|
||||||
- ./ci.py --package-linux-flatpak
|
# - ./ci.py --package-linux-archive
|
||||||
|
|
||||||
- name: Package Linux Archive Artifact
|
# - name: Push Artifacts to the Release Volume
|
||||||
commands:
|
# commands:
|
||||||
- ./ci.py --package-linux-archive
|
# - git add -v *.AppImage *.AppImage.zsync *.flatpak *.apk *.apk.idsig *.tar.zstd
|
||||||
|
# - git commit -m Release
|
||||||
- name: Push Artifacts to the Release Volume
|
# - git archive --format=tar HEAD | podman volume import release -
|
||||||
commands:
|
|
||||||
- git add -v *.AppImage *.AppImage.zsync *.flatpak *.apk *.apk.idsig *.tar.zstd
|
|
||||||
- git commit -m Release
|
|
||||||
- git archive --format=tar HEAD | podman volume import release -
|
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
|
|
|
@ -21,6 +21,12 @@ if (flutterVersionName == null) {
|
||||||
flutterVersionName = '1.0'
|
flutterVersionName = '1.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def keystoreProperties = new Properties()
|
||||||
|
def keystorePropertiesFile = rootProject.file('key.properties')
|
||||||
|
if (keystorePropertiesFile.exists()) {
|
||||||
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||||
|
}
|
||||||
|
|
||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||||
|
@ -55,11 +61,18 @@ android {
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
keyAlias keystoreProperties['keyAlias']
|
||||||
|
keyPassword keystoreProperties['keyPassword']
|
||||||
|
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
||||||
|
storePassword keystoreProperties['storePassword']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
// TODO: Add your own signing config for the release build.
|
signingConfig signingConfigs.release
|
||||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
|
||||||
signingConfig signingConfigs.debug
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
14
ci.py
14
ci.py
|
@ -22,10 +22,12 @@ def podman_offline(dir, *args):
|
||||||
subprocess.run(["podman", "run", "--rm", "--network=none", "--cap-add=CHOWN", f"--workdir={dir}",
|
subprocess.run(["podman", "run", "--rm", "--network=none", "--cap-add=CHOWN", f"--workdir={dir}",
|
||||||
"-v", os.getcwd() + f":{CONTAINER_HOME}/src",
|
"-v", os.getcwd() + f":{CONTAINER_HOME}/src",
|
||||||
"-v", f"{HOST_HOME}/fdroid:{CONTAINER_HOME}/fdroid",
|
"-v", f"{HOST_HOME}/fdroid:{CONTAINER_HOME}/fdroid",
|
||||||
"-v", f"{HOST_HOME}/fdroid-keystore:{CONTAINER_HOME}/fdroid/fdroid-keystore",
|
"-v", f"{HOST_HOME}/fdroid-keystore:{CONTAINER_HOME}/fdroid-keystore",
|
||||||
"-v", f"{HOST_HOME}/standalone-keystore:{CONTAINER_HOME}/fdroid/standalone-keystore",
|
"-v", f"{HOST_HOME}/standalone-keystore:{CONTAINER_HOME}/standalone-keystore",
|
||||||
|
"-v", f"{HOST_HOME}/google-keystore:{CONTAINER_HOME}/google-keystore",
|
||||||
"--env", "FDROID_KEYSTORE_PASS=" + os.environ.get('FDROID_KEYSTORE_PASS'),
|
"--env", "FDROID_KEYSTORE_PASS=" + os.environ.get('FDROID_KEYSTORE_PASS'),
|
||||||
"--env", "STANDALONE_KEYSTORE_PASS=" + os.environ.get('STANDALONE_KEYSTORE_PASS'),
|
"--env", "STANDALONE_KEYSTORE_PASS=" + os.environ.get('STANDALONE_KEYSTORE_PASS'),
|
||||||
|
"--env", "GOOGLE_KEYSTORE_CONF=" + os.environ.get('GOOGLE_KEYSTORE_CONF'),
|
||||||
"--user", os.getuid().__str__() + ":" + os.getgid().__str__(), "--userns=keep-id",
|
"--user", os.getuid().__str__() + ":" + os.getgid().__str__(), "--userns=keep-id",
|
||||||
CONTAINER_IMAGE, "bash", "-c", ' '.join(args)
|
CONTAINER_IMAGE, "bash", "-c", ' '.join(args)
|
||||||
], check=True)
|
], check=True)
|
||||||
|
@ -48,13 +50,18 @@ def build_apk():
|
||||||
podman_offline(f"{CONTAINER_HOME}/src", "chown -R $(id -u):$(id -g) /tmp/gradle /tmp/flutter_pub_cache",
|
podman_offline(f"{CONTAINER_HOME}/src", "chown -R $(id -u):$(id -g) /tmp/gradle /tmp/flutter_pub_cache",
|
||||||
"&& flutter pub get --offline",
|
"&& flutter pub get --offline",
|
||||||
"&& flutter build apk --flavor production")
|
"&& flutter build apk --flavor production")
|
||||||
|
def build_bundle():
|
||||||
|
podman_offline(f"{CONTAINER_HOME}/src", "chown -R $(id -u):$(id -g) /tmp/gradle /tmp/flutter_pub_cache",
|
||||||
|
"&& echo $GOOGLE_KEYSTORE_CONF > android/key.properties",
|
||||||
|
"&& flutter pub get --offline",
|
||||||
|
"&& flutter build appbundle --flavor production")
|
||||||
|
|
||||||
def sign_apk_standalone():
|
def sign_apk_standalone():
|
||||||
podman_offline(f"{CONTAINER_HOME}/src",
|
podman_offline(f"{CONTAINER_HOME}/src",
|
||||||
"zipalign -f -v 4 build/app/outputs/flutter-apk/app-production-release.apk",
|
"zipalign -f -v 4 build/app/outputs/flutter-apk/app-production-release.apk",
|
||||||
f"standalone_{APP_NAME}-{APP_SEMVER}.apk")
|
f"standalone_{APP_NAME}-{APP_SEMVER}.apk")
|
||||||
podman_offline(f"{CONTAINER_HOME}/src",
|
podman_offline(f"{CONTAINER_HOME}/src",
|
||||||
"apksigner sign --ks ../fdroid/standalone-keystore --ks-key-alias standalone --ks-pass",
|
f"apksigner sign --ks {CONTAINER_HOME}/standalone-keystore --ks-key-alias standalone --ks-pass",
|
||||||
f"env:STANDALONE_KEYSTORE_PASS standalone_{APP_NAME}-{APP_SEMVER}.apk")
|
f"env:STANDALONE_KEYSTORE_PASS standalone_{APP_NAME}-{APP_SEMVER}.apk")
|
||||||
|
|
||||||
def sign_apk_fdroid():
|
def sign_apk_fdroid():
|
||||||
|
@ -113,6 +120,7 @@ if __name__ == "__main__":
|
||||||
group = parser.add_mutually_exclusive_group()
|
group = parser.add_mutually_exclusive_group()
|
||||||
group.add_argument("--build-linux", action="store_true")
|
group.add_argument("--build-linux", action="store_true")
|
||||||
group.add_argument("--build-apk", action="store_true")
|
group.add_argument("--build-apk", action="store_true")
|
||||||
|
group.add_argument("--build-bundle", action="store_true", help="depends on $GOOGLE_KEYSTORE_CONF")
|
||||||
group.add_argument("--sign-apk-standalone", action="store_true", help="depends on $STANDALONE_KEYSTORE_PASS")
|
group.add_argument("--sign-apk-standalone", action="store_true", help="depends on $STANDALONE_KEYSTORE_PASS")
|
||||||
group.add_argument("--sign-apk-fdroid", action="store_true", help="depends on $FDROID_KEYSTORE_PASS")
|
group.add_argument("--sign-apk-fdroid", action="store_true", help="depends on $FDROID_KEYSTORE_PASS")
|
||||||
group.add_argument("--package-linux-appimage", action="store_true")
|
group.add_argument("--package-linux-appimage", action="store_true")
|
||||||
|
|
Loading…
Reference in a new issue