Skip to content

Commit

Permalink
Merge pull request #735 from aiselp/dev-test
Browse files Browse the repository at this point in the history
构建流程更新,bug修复
  • Loading branch information
kkevsekk1 authored Nov 21, 2023
2 parents 8b32c84 + 68edaf7 commit 3a137f5
Show file tree
Hide file tree
Showing 31 changed files with 9,252 additions and 1,071 deletions.
44 changes: 20 additions & 24 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,26 @@ jobs:
steps:
- name: Set output
id: vars
run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/}
run: |
echo "short_ref=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: checkout
id: check
uses: actions/checkout@v1
uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Build inrt template
run: |
chmod 777 ./gradlew
./gradlew inrt:assembleTemplate
ls
- uses: Tlaster/[email protected]
name: Sign inrt APK
with:
releaseDirectory: |
inrt/build/outputs/apk/template/release
signingKeyBase64: ${{ secrets.ISIGNING_KEY }}
output: build/inrt/signed
alias: ${{ secrets.IALIAS }}
keyStorePassword: ${{ secrets.IKEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.IKEY_PASSWORD }}
./gradlew app:buildTemplateApp
- name: Build App
run: |
ls build/inrt/signed
pwd
mv build/inrt/signed/*.apk app/src/main/assets/template.apk
ls app/src/main/assets
./gradlew app:assembleV6
- uses: Tlaster/[email protected]
name: Sign app APK
Expand All @@ -50,14 +41,21 @@ jobs:
alias: ${{ secrets.AALIAS }}
keyStorePassword: ${{ secrets.AKEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.AKEY_PASSWORD }}
- name: rename apk
run: |
cd build/app/signed
mv app-v6-arm64-v8a-*.apk Autox-v6-arm64-v8a-release-${{steps.vars.outputs.short_ref}}.apk
mv app-v6-armeabi-v7a-*.apk Autox-v6-armeabi-v7a-release-${{steps.vars.outputs.short_ref}}.apk
mv app-v6-universal-*.apk Autox-v6-universal-release-${{steps.vars.outputs.short_ref}}.apk
ls
- name: create-gh-release
if: github.repository == 'kkevsekk1/AutoX'
uses: taiki-e/create-gh-release-action@v1
with:
changelog: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: release
- name: create-release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
Expand All @@ -69,9 +67,7 @@ jobs:
endpoint: oss-cn-hangzhou.aliyuncs.com
access-key-id: ${{ secrets.OSS_KEY_ID }}
access-key-secret: ${{ secrets.OSS_KEY_SECRET }}
- name: mkdir aliyun
- name: update apk to aliyun
if: github.repository == 'kkevsekk1/AutoX'
run: ossutil mkdir oss://autoxjsoss/autoxjs/${{ steps.vars.outputs.short_ref }}
- name: cp files to aliyun
if: github.repository == 'kkevsekk1/AutoX'
run: ossutil cp -rf build/app/signed oss://autoxjsoss/autoxjs/${{ steps.vars.outputs.short_ref }}
ossutil cp -rf build/app/signed oss://autoxjsoss/autoxjs/${{ steps.vars.outputs.short_ref }}
3 changes: 2 additions & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
name: Mark stale issues and pull requests

on:
workflow_dispatch:
schedule:
- cron: '27 23 * * *'

Expand All @@ -23,6 +24,6 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-label: '无活动'
stale-pr-label: '无活动'
close-issue-reason: '此lssue由于长期未活动已被自动关闭,如问题任然存在,请重新打开lssue'
close-issue-message: '此lssue由于长期未活动已被自动关闭,如问题任然存在,请重新打开lssue'
close-pr-message: '此pr由于长期未活动已被自动关闭'

16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,27 +128,25 @@

##### 本地安装调试版本到设备:
```shell
./gradlew inrt:assembleTemplateDebug && ./gradlew inrt:cp2APPDebug && ./gradlew app:assembleV6Debug && ./gradlew app:installV6Debug
./gradlew app:buildDebugTemplateApp && ./gradlew app:assembleV6Debug && ./gradlew app:installV6Debug
#
./gradlew inrt:assembleTemplateDebug ; ./gradlew inrt:cp2APPDebug ; ./gradlew app:assembleV6Debug ; ./gradlew app:installV6Debug
./gradlew app:buildDebugTemplateApp ; ./gradlew app:assembleV6Debug ; ./gradlew app:installV6Debug
```
生成的调试版本APK文件在 app/build/outputs/apk/v6/debug 下,使用默认签名

##### 本地编译发布版本:
```shell
./gradlew inrt:assembleTemplate && ./gradlew inrt:cp2APP && ./gradlew app:assembleV6
./gradlew app:buildTemplateApp && ./gradlew inrt:cp2APP && ./gradlew app:assembleV6
#
./gradlew inrt:assembleTemplate ; ./gradlew inrt:cp2APP ; ./gradlew app:assembleV6
./gradlew app:buildTemplateApp ; ./gradlew inrt:cp2APP ; ./gradlew app:assembleV6
```
生成的是未签名的APK文件,在 app/build/outputs/apk/v6/release 下,需要签名后才能安装

##### 本地 Android Studio 运行调试版本到设备:
先运行以下命令:

```shell
./gradlew inrt:assembleTemplate && ./gradlew inrt:cp2APP
#
./gradlew inrt:assembleTemplate ; ./gradlew inrt:cp2APP
./gradlew app:buildDebugTemplateApp
```

再点击 Android Studio 运行按钮
Expand All @@ -157,9 +155,7 @@
先运行以下命令:

```shell
./gradlew inrt:assembleTemplate && ./gradlew inrt:cp2APP
#
./gradlew inrt:assembleTemplate ; ./gradlew inrt:cp2APP
./gradlew app:buildTemplateApp
```

再点击 Android Studio 菜单 "Build" -> "Generate Signed Bundle /APK..." -> 勾选"APK" -> "Next" -> 选择或新建证书 -> "Next" -> 选择"v6Release" -> "Finish"
Expand Down
16 changes: 6 additions & 10 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,27 +109,25 @@ Command description: Run the command in the project root directory, if using Win

##### Install the debug build locally to the device:
```shell
./gradlew inrt:assembleTemplateDebug && ./gradlew inrt:cp2APPDebug && ./gradlew app:assembleV6Debug && ./gradlew app:installV6Debug
./gradlew app:buildDebugTemplateApp && ./gradlew app:assembleV6Debug && ./gradlew app:installV6Debug
#or
./gradlew inrt:assembleTemplateDebug ; ./gradlew inrt:cp2APPDebug ; ./gradlew app:assembleV6Debug ; ./gradlew app:installV6Debug
./gradlew app:buildDebugTemplateApp ; ./gradlew app:assembleV6Debug ; ./gradlew app:installV6Debug
```
The generated debug version APK file is under app/build/outputs/apk/v6/debug with the default signature

##### Compile the release version locally:
```shell
./gradlew inrt:assembleTemplate && ./gradlew inrt:cp2APP && ./gradlew app:assembleV6
./gradlew app:buildTemplateApp && ./gradlew inrt:cp2APP && ./gradlew app:assembleV6
#or
./gradlew inrt:assembleTemplate ; ./gradlew inrt:cp2APP ; ./gradlew app:assembleV6
./gradlew app:buildTemplateApp ; ./gradlew inrt:cp2APP ; ./gradlew app:assembleV6
```
The generated APK file is an unsigned APK file. Under app/build/outputs/apk/v6/release, it needs to be signed before it can be installed.

##### Local Android Studio to run the debug build to the device:
First run the following command:

```shell
./gradlew inrt:assembleTemplate && ./gradlew inrt:cp2APP
#or
./gradlew inrt:assembleTemplate ; ./gradlew inrt:cp2APP
./gradlew app:buildDebugTemplateApp
```

Then click the Android Studio Run button
Expand All @@ -138,9 +136,7 @@ Then click the Android Studio Run button
First run the following command:

```shell
./gradlew inrt:assembleTemplate && ./gradlew inrt:cp2APP
#or
./gradlew inrt:assembleTemplate ; ./gradlew inrt:cp2APP
./gradlew app:buildTemplateApp
```

Then click Android Studio menu "Build" -> "Generate Signed Bundle APK..." -> check "APK"
Expand Down
4 changes: 3 additions & 1 deletion apkbuilder/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ dependencies {

implementation(libs.okhttp)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.espresso.core)
androidTestImplementation(libs.espresso.core){
exclude(group = "com.android.support",module = "support-annotations")
}
testImplementation(libs.junit)
api(files("libs/tiny-sign-0.9.jar"))
api(libs.commons.io)
Expand Down
39 changes: 0 additions & 39 deletions apkbuilder/oldbuild.gradle

This file was deleted.

66 changes: 43 additions & 23 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import com.android.build.gradle.internal.tasks.factory.dependsOn
import java.util.Properties

plugins {
Expand All @@ -7,7 +8,6 @@ plugins {
id("kotlin-kapt")
}

val AAVersion = "4.5.2"
//val SupportLibVersion = "28.0.0"

val propFile: File = File("E:/资料/jks/autojs-app/sign.properties");
Expand Down Expand Up @@ -166,35 +166,26 @@ android {
}

dependencies {
val AAVersion = "4.5.2"

implementation("androidx.localbroadcastmanager:localbroadcastmanager:1.1.0")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
val accompanist_version = "0.24.13-rc"
implementation("com.google.accompanist:accompanist-permissions:0.24.13-rc")
implementation("com.google.accompanist:accompanist-pager-indicators:$accompanist_version")
implementation("com.google.accompanist:accompanist-pager:$accompanist_version")
implementation("com.google.accompanist:accompanist-swiperefresh:$accompanist_version")
implementation("com.google.accompanist:accompanist-appcompat-theme:$accompanist_version")
implementation("com.google.accompanist:accompanist-insets:$accompanist_version")
implementation("com.google.accompanist:accompanist-insets-ui:$accompanist_version")
implementation("com.google.accompanist:accompanist-systemuicontroller:$accompanist_version")
implementation("com.google.accompanist:accompanist-webview:$accompanist_version")

implementation("androidx.compose.ui:ui:$compose_version")
implementation("androidx.compose.material:material:$compose_version")
implementation("androidx.compose.ui:ui-tooling-preview:$compose_version")
implementation("androidx.activity:activity-compose:1.3.1")
// implementation("org.chromium.net:cronet-embedded:76.3809.111")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:$compose_version")
debugImplementation("androidx.compose.ui:ui-tooling:$compose_version")
implementation(libs.bundles.accompanist)

implementation(libs.compose.ui)
implementation(libs.compose.material)
implementation(libs.compose.ui.tooling.preview)
androidTestImplementation(libs.compose.ui.test.junit4)
debugImplementation(libs.compose.ui.tooling)
implementation(libs.activity.compose)

androidTestImplementation("androidx.test.espresso:espresso-core:3.1.1-alpha01") {
androidTestImplementation(libs.espresso.core) {
exclude(group = "com.android.support", module = "support-annotations")
}
testImplementation(libs.junit)
// Kotlin携程
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.2")
implementation(libs.kotlinx.coroutines.android)
// Android Annotations
annotationProcessor("org.androidannotations:androidannotations:$AAVersion")
kapt("org.androidannotations:androidannotations:$AAVersion")
Expand All @@ -208,9 +199,9 @@ dependencies {
kapt("com.jakewharton:butterknife-compiler:10.2.3")
// Android supports
implementation("androidx.preference:preference-ktx:1.2.0")
implementation("androidx.appcompat:appcompat:1.4.2") //
implementation(libs.appcompat) //
implementation("androidx.cardview:cardview:1.0.0")
implementation("com.google.android.material:material:1.7.0-alpha03")
implementation(libs.material)
// Personal libraries
implementation("com.github.hyb1996:MutableTheme:1.0.0")
// Material Dialogs
Expand Down Expand Up @@ -247,7 +238,6 @@ dependencies {
// Retrofit
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.retrofit2:converter-gson:2.9.0")
implementation("com.squareup.retrofit2:converter-gson:2.9.0")
debugImplementation("com.squareup.leakcanary:leakcanary-android:2.8.1")
releaseImplementation("com.squareup.leakcanary:leakcanary-android-no-op:1.6.3")
// Optional, if you use support library fragments:
Expand Down Expand Up @@ -311,3 +301,33 @@ dependencies {
implementation("androidx.viewpager2:viewpager2:1.1.0-beta01")
implementation("io.coil-kt:coil-compose:2.0.0-rc03")
}

fun copyTemplateToAPP(isDebug: Boolean, to: File) {
val outName = if (isDebug) "template-debug" else "template-release"
val outFile = project(":inrt").buildOutputs.named(outName).get().outputFile
copy {
from(outFile)
into(to)
delete(File(to, "template.apk"))
rename(outFile.name, "template.apk")
}
logger.lifecycle("buildTemplate success, debugMode: $isDebug")
}

val assetsDir = File(projectDir, "src/main/assets")
if (!File(assetsDir, "template.apk").isFile) {
tasks.named("preBuild").dependsOn("buildTemplateApp")
}

tasks.register("buildTemplateApp") {
dependsOn(":inrt:assembleTemplateRelease")
doFirst {
copyTemplateToAPP(false, assetsDir)
}
}
tasks.register("buildDebugTemplateApp") {
dependsOn(":inrt:assembleTemplateDebug")
doFirst {
copyTemplateToAPP(true, assetsDir)
}
}
Loading

0 comments on commit 3a137f5

Please sign in to comment.