chore: 迁移至 App Center
This commit is contained in:
parent
1a2c9de478
commit
d04685a3b5
|
|
@ -1,81 +0,0 @@
|
||||||
version: 2.1
|
|
||||||
|
|
||||||
orbs:
|
|
||||||
app-center: rakutentech/app-center@0.1.3
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
working_directory: ~/code
|
|
||||||
|
|
||||||
docker:
|
|
||||||
- image: circleci/android:api-30-ndk
|
|
||||||
|
|
||||||
environment:
|
|
||||||
JVM_OPTS: -Xmx4G
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
name: Create release.keystore.jks
|
|
||||||
command: openssl aes-256-cbc -d -in "${releaseKeyStore}.encrypted" -k $RELEASE_ENCRYPT_SECRET_KEY -md md5 >> $releaseKeyStore
|
|
||||||
- run:
|
|
||||||
name: Create keystore.properies
|
|
||||||
command: printf 'releaseKeyAlias=%s\nreleaseKeyPassword=%s\nreleaseKeyStore=%s\nreleaseStorePassword=%s' $releaseKeyAlias $releaseKeyPassword $releaseKeyStore $releaseStorePassword > keystore.properties
|
|
||||||
- restore_cache:
|
|
||||||
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
|
|
||||||
- run:
|
|
||||||
name: Fix 'Permission denied'
|
|
||||||
command: chmod +x ./gradlew
|
|
||||||
- run:
|
|
||||||
name: Download Dependencies
|
|
||||||
command: ./gradlew androidDependencies
|
|
||||||
- save_cache:
|
|
||||||
paths:
|
|
||||||
- ~/.gradle
|
|
||||||
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
|
|
||||||
- run:
|
|
||||||
name: Initial build
|
|
||||||
command: ./gradlew clean assembleRelease --no-daemon --stacktrace
|
|
||||||
- store_artifacts:
|
|
||||||
path: app/build/outputs/apk/release/
|
|
||||||
destination: apk/
|
|
||||||
- store_artifacts:
|
|
||||||
path: app/build/outputs/mapping/release/
|
|
||||||
destination: mapping/
|
|
||||||
- run:
|
|
||||||
name: Define Environment Variable at Runtime
|
|
||||||
command: |
|
|
||||||
echo "export APP_VERSION_NAME=\$(cat ./app/build/outputs/apk/release/output-metadata.json | jq '.elements[0].versionName' | awk -F '\"' '{print \$2}')" >> $BASH_ENV
|
|
||||||
echo "export APP_OUTPUT_FILE=\$(cat ./app/build/outputs/apk/release/output-metadata.json | jq '.elements[0].outputFile' | awk -F '\"' '{print \$2}')" >> $BASH_ENV
|
|
||||||
echo "export APP_VERSION_CODE=\$(cat ./app/build/outputs/apk/release/output-metadata.json | jq '.elements[0].versionCode'" >> $BASH_ENV
|
|
||||||
source $BASH_ENV
|
|
||||||
|
|
||||||
workflows:
|
|
||||||
version: 2
|
|
||||||
build_and_upload:
|
|
||||||
jobs:
|
|
||||||
- build
|
|
||||||
- app-center/publish:
|
|
||||||
working_directory: ~/code/app/build/outputs/apk/release
|
|
||||||
name: Publish to App Center
|
|
||||||
group: HuanCheng65
|
|
||||||
file: $APP_OUTPUT_FILE
|
|
||||||
app: TiebaLite
|
|
||||||
token: $APP_CENTER_TOKEN
|
|
||||||
notes: $APP_VERSION_NAME
|
|
||||||
- app-center/mapping:
|
|
||||||
working_directory: ~/code/app/build/outputs/mapping/release
|
|
||||||
name: Upload to App Center
|
|
||||||
file: mapping.txt
|
|
||||||
app: TiebaLite
|
|
||||||
token: $APP_CENTER_TOKEN
|
|
||||||
version-name: $APP_VERSION_NAME
|
|
||||||
version-code: $APP_VERSION_CODE
|
|
||||||
|
|
||||||
workflows:
|
|
||||||
version: 2
|
|
||||||
build_and_upload:
|
|
||||||
jobs:
|
|
||||||
- build
|
|
||||||
- upload_apk
|
|
||||||
- upload_mapping
|
|
||||||
|
|
@ -8,12 +8,12 @@ def keystoreProperties = new Properties()
|
||||||
keystoreProperties.load(new FileInputStream(rootProject.file("keystore.properties")))
|
keystoreProperties.load(new FileInputStream(rootProject.file("keystore.properties")))
|
||||||
def applicationProperties = new Properties()
|
def applicationProperties = new Properties()
|
||||||
applicationProperties.load(new FileInputStream(rootProject.file("application.properties")))
|
applicationProperties.load(new FileInputStream(rootProject.file("application.properties")))
|
||||||
def SHA1 = System.getenv("CIRCLE_SHA1")
|
def buildId = System.getenv("APPCENTER_BUILD_ID")
|
||||||
def applicationVersionCode = applicationProperties["versionCode"].toInteger()
|
def applicationVersionCode = applicationProperties["versionCode"].toInteger()
|
||||||
def applicationVersionName = applicationProperties["versionName"]
|
def applicationVersionName = applicationProperties["versionName"]
|
||||||
def isPerVersion = applicationProperties["isPerRelease"] == "true"
|
def isPerVersion = applicationProperties["isPerRelease"] == "true"
|
||||||
if (SHA1 != null) {
|
if (buildId != null) {
|
||||||
applicationVersionName = applicationVersionName + ".${SHA1.substring(0, 7)}"
|
applicationVersionName = applicationVersionName + ".${buildId.substring(0, 7)}"
|
||||||
}
|
}
|
||||||
if (isPerVersion) {
|
if (isPerVersion) {
|
||||||
applicationVersionName = applicationVersionName + ".${applicationProperties["preReleaseName"]}-${applicationProperties["preReleaseVer"]}"
|
applicationVersionName = applicationVersionName + ".${applicationProperties["preReleaseName"]}-${applicationProperties["preReleaseVer"]}"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
openssl aes-256-cbc -d -in "${releaseKeyStore}.encrypted" -k $RELEASE_ENCRYPT_SECRET_KEY -md md5 >> $releaseKeyStore
|
||||||
|
|
||||||
|
printf 'releaseKeyAlias=%s\nreleaseKeyPassword=%s\nreleaseKeyStore=%s\nreleaseStorePassword=%s' $releaseKeyAlias $releaseKeyPassword $releaseKeyStore $releaseStorePassword > keystore.properties
|
||||||
|
|
||||||
|
chmod +x ./gradlew
|
||||||
Loading…
Reference in New Issue