From 29275cb5cef0304a77ad6d762ac013c9ad540893 Mon Sep 17 00:00:00 2001 From: ydfq25 <155884087+ydfq25@users.noreply.github.com> Date: Mon, 9 Sep 2024 05:48:13 +0800 Subject: [PATCH 1/8] Create android.yml --- .github/workflows/android.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/android.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..91a69d1 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,26 @@ +name: Android CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew build From 4c9f621e642008d3aab238fd4706baa14c1f8e2b Mon Sep 17 00:00:00 2001 From: ydfq25 <155884087+ydfq25@users.noreply.github.com> Date: Mon, 9 Sep 2024 05:49:54 +0800 Subject: [PATCH 2/8] Delete .github/workflows/android.yml --- .github/workflows/android.yml | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 .github/workflows/android.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml deleted file mode 100644 index 91a69d1..0000000 --- a/.github/workflows/android.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Android CI - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: set up JDK 11 - uses: actions/setup-java@v4 - with: - java-version: '11' - distribution: 'temurin' - cache: gradle - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Build with Gradle - run: ./gradlew build From 6f9fc7d0910b7c10230f8bc6644ef5c83a03ffac Mon Sep 17 00:00:00 2001 From: ydfq25 <155884087+ydfq25@users.noreply.github.com> Date: Mon, 9 Sep 2024 05:58:26 +0800 Subject: [PATCH 3/8] Create android.yml --- .github/workflows/android.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/android.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..b3956a0 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,34 @@ +name: Build and Package App + +on: + push: + branches: + - main # 触发条件:当推送到 main 分支时 + pull_request: + branches: + - main # 触发条件:当对 main 分支发起拉取请求时 + +jobs: + build: + runs-on: ubuntu-latest # 使用最新的 Ubuntu 环境 + + steps: + - name: Checkout code + uses: actions/checkout@v2 # 检出代码 + + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: '11' # 设置 Java 版本 + + - name: Build with Gradle + run: ./gradlew build # 使用 Gradle 构建项目 + + - name: Package APK + run: ./gradlew assembleRelease # 打包 APK + + - name: Upload APK + uses: actions/upload-artifact@v2 + with: + name: my-app-apk + path: app/build/outputs/apk/release/app-release.apk # 上传生成的 APK From b14cbb7f20c5047cfd7e52c7fe1f7d175bb4d9bb Mon Sep 17 00:00:00 2001 From: ydfq25 <155884087+ydfq25@users.noreply.github.com> Date: Mon, 9 Sep 2024 06:01:13 +0800 Subject: [PATCH 4/8] Delete .github/workflows/android.yml --- .github/workflows/android.yml | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 .github/workflows/android.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml deleted file mode 100644 index b3956a0..0000000 --- a/.github/workflows/android.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Build and Package App - -on: - push: - branches: - - main # 触发条件:当推送到 main 分支时 - pull_request: - branches: - - main # 触发条件:当对 main 分支发起拉取请求时 - -jobs: - build: - runs-on: ubuntu-latest # 使用最新的 Ubuntu 环境 - - steps: - - name: Checkout code - uses: actions/checkout@v2 # 检出代码 - - - name: Set up JDK - uses: actions/setup-java@v2 - with: - java-version: '11' # 设置 Java 版本 - - - name: Build with Gradle - run: ./gradlew build # 使用 Gradle 构建项目 - - - name: Package APK - run: ./gradlew assembleRelease # 打包 APK - - - name: Upload APK - uses: actions/upload-artifact@v2 - with: - name: my-app-apk - path: app/build/outputs/apk/release/app-release.apk # 上传生成的 APK From 283726554214fdd3c0907ad56e93239f9bdae6b0 Mon Sep 17 00:00:00 2001 From: ydfq25 <155884087+ydfq25@users.noreply.github.com> Date: Mon, 9 Sep 2024 06:01:31 +0800 Subject: [PATCH 5/8] Create android.yml --- .github/workflows/android.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/android.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..b3956a0 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,34 @@ +name: Build and Package App + +on: + push: + branches: + - main # 触发条件:当推送到 main 分支时 + pull_request: + branches: + - main # 触发条件:当对 main 分支发起拉取请求时 + +jobs: + build: + runs-on: ubuntu-latest # 使用最新的 Ubuntu 环境 + + steps: + - name: Checkout code + uses: actions/checkout@v2 # 检出代码 + + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: '11' # 设置 Java 版本 + + - name: Build with Gradle + run: ./gradlew build # 使用 Gradle 构建项目 + + - name: Package APK + run: ./gradlew assembleRelease # 打包 APK + + - name: Upload APK + uses: actions/upload-artifact@v2 + with: + name: my-app-apk + path: app/build/outputs/apk/release/app-release.apk # 上传生成的 APK From abb728d942c560e10b870845f85df8e2218a783f Mon Sep 17 00:00:00 2001 From: ydfq25 <155884087+ydfq25@users.noreply.github.com> Date: Mon, 9 Sep 2024 06:05:08 +0800 Subject: [PATCH 6/8] Update android.yml --- .github/workflows/android.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index b3956a0..ad8377e 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -1,12 +1,7 @@ name: Build and Package App on: - push: - branches: - - main # 触发条件:当推送到 main 分支时 - pull_request: - branches: - - main # 触发条件:当对 main 分支发起拉取请求时 + workflow_dispatch: # 手动触发工作流 jobs: build: From 7b4a99950220e923bd33be984afb3ebab6489631 Mon Sep 17 00:00:00 2001 From: ydfq25 <155884087+ydfq25@users.noreply.github.com> Date: Mon, 9 Sep 2024 06:08:40 +0800 Subject: [PATCH 7/8] Update android.yml --- .github/workflows/android.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index ad8377e..a13530f 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -9,12 +9,13 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 # 检出代码 + uses: actions/checkout@v3 # 更新到最新版本 - name: Set up JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 # 更新到最新版本 with: java-version: '11' # 设置 Java 版本 + distribution: 'adopt' # 添加缺失的输入参数 - name: Build with Gradle run: ./gradlew build # 使用 Gradle 构建项目 @@ -23,7 +24,7 @@ jobs: run: ./gradlew assembleRelease # 打包 APK - name: Upload APK - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 # 更新到最新版本 with: name: my-app-apk path: app/build/outputs/apk/release/app-release.apk # 上传生成的 APK From 8fc854062459e4049339331d9743f3258235183b Mon Sep 17 00:00:00 2001 From: ydfq25 <155884087+ydfq25@users.noreply.github.com> Date: Mon, 9 Sep 2024 06:10:03 +0800 Subject: [PATCH 8/8] Update android.yml --- .github/workflows/android.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index a13530f..49d5557 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -9,10 +9,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 # 更新到最新版本 + uses: actions/checkout@v3 # 使用最新版本 - name: Set up JDK - uses: actions/setup-java@v3 # 更新到最新版本 + uses: actions/setup-java@v3 # 使用最新版本 with: java-version: '11' # 设置 Java 版本 distribution: 'adopt' # 添加缺失的输入参数 @@ -24,7 +24,7 @@ jobs: run: ./gradlew assembleRelease # 打包 APK - name: Upload APK - uses: actions/upload-artifact@v3 # 更新到最新版本 + uses: actions/upload-artifact@v3 # 使用最新版本 with: name: my-app-apk path: app/build/outputs/apk/release/app-release.apk # 上传生成的 APK