From a3abed0a03d04edc16371b34ce8c70e6b9381d80 Mon Sep 17 00:00:00 2001 From: VillagerTom Date: Tue, 20 Feb 2024 13:07:27 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E6=96=B0=E5=A2=9Ealpha.yml,=20=E7=94=A8?= =?UTF-8?q?=E4=BA=8E=E7=BC=96=E8=AF=91=E6=8E=A8=E9=80=81=E8=87=B3alpha?= =?UTF-8?q?=E5=88=86=E6=94=AF=E7=9A=84=E4=BB=A3=E7=A0=81=E5=B9=B6=E5=8F=91?= =?UTF-8?q?=E9=80=81=E8=87=B3Telegram=E9=A2=91=E9=81=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/alpha.yml | 209 ++++++++++++++++++++++++++++++++++++ 1 file changed, 209 insertions(+) create mode 100644 .github/workflows/alpha.yml diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml new file mode 100644 index 000000000..e56fb2f94 --- /dev/null +++ b/.github/workflows/alpha.yml @@ -0,0 +1,209 @@ +name: CI + +on: + workflow_dispatch: + push: + branches: + - 'alpha' + paths-ignore: + - '**.md' + - '**.txt' + - '.github/**' + - '.idea/**' + - '!.github/workflows/**' + +jobs: + update_version: + name: Read and update version + runs-on: ubuntu-latest + + outputs: + # 定义输出变量 version,以便在其他job中引用 + new_version: ${{ steps.version.outputs.new_version }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.ref_name }} + + - name: 获取first parent commit次数 + id: get-first-parent-commit-count + run: | + version=$(yq e .version pubspec.yaml | cut -d "+" -f 1) + git fetch origin "refs/tags/*:refs/tags/*" + recent_release_tag=$(git tag -l | grep $version | egrep -v "[-|+]" || true) + if [[ "x$recent_release_tag" == "x" ]]; then + echo "当前版本tag不存在,请手动生成tag." + exit 1 + fi + first_parent_commit_count=$(git rev-list --first-parent --count $recent_release_tag..FETCH_HEAD) + echo "count=$first_parent_commit_count" >> $GITHUB_OUTPUT + + - name: 更新版本号 + id: version + run: | + # 读取版本号 + VERSION=$(yq e .version pubspec.yaml | cut -d "+" -f 1) + + # 获取GitHub Actions的run_number + #RUN_NUMBER=${{ github.run_number }} + + # 构建新版本号 + NEW_VERSION=$VERSION-alpha.${{ steps.get-first-parent-commit-count.outputs.count }} + + # 输出新版本号 + echo "New version: $NEW_VERSION" + + # 设置新版本号为输出变量 + echo "new_version=$NEW_VERSION" >>$GITHUB_OUTPUT + + android: + name: Build CI (Android) + needs: update_version + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: 构建Java环境 + uses: actions/setup-java@v3 + with: + distribution: "zulu" + java-version: "17" + token: ${{secrets.GIT_TOKEN}} + + - name: 检查缓存 + uses: actions/cache@v2 + id: cache-flutter + with: + path: /root/flutter-sdk + key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }} + + - name: 安装Flutter + if: steps.cache-flutter.outputs.cache-hit != 'true' + uses: subosito/flutter-action@v2 + with: + flutter-version: 3.16.5 + channel: any + + - name: 下载项目依赖 + run: flutter pub get + + - name: 解码生成 jks + run: echo $KEYSTORE_BASE64 | base64 -di > android/app/vvex.jks + env: + KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} + + - name: 更新版本号 + id: version + run: | + # 更新pubspec.yaml文件中的版本号 + sed -i "s/version: .*+/version: ${{ needs.update_version.outputs.new_version }}+/g" pubspec.yaml + + - name: flutter build apk + run: flutter build apk --release --split-per-abi + env: + KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} + KEY_ALIAS: ${{ secrets.KEY_ALIAS }} + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD}} + + - name: 重命名应用 + run: | + for file in build/app/outputs/flutter-apk/app-*.apk; do + if [[ $file =~ app-(.?*)release.apk ]]; then + new_file_name="build/app/outputs/flutter-apk/Pili-${BASH_REMATCH[1]}${{ needs.update_version.outputs.new_version }}.apk" + mv "$file" "$new_file_name" + fi + done + + - name: 上传 + uses: actions/upload-artifact@v3 + with: + name: Pilipala-CI + path: | + build/app/outputs/flutter-apk/Pili-*.apk + + iOS: + name: Build CI (iOS) + needs: update_version + runs-on: macos-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: 安装Flutter + if: steps.cache-flutter.outputs.cache-hit != 'true' + uses: subosito/flutter-action@v2.10.0 + with: + cache: true + flutter-version: 3.16.5 + + - name: 更新版本号 + id: version + run: | + # 更新pubspec.yaml文件中的版本号 + sed -i "" "s/version: .*+/version: ${{ needs.update_version.outputs.new_version }}+/g" pubspec.yaml + + - name: flutter build ipa + run: | + flutter build ios --release --no-codesign + ln -sf ./build/ios/iphoneos Payload + zip -r9 app.ipa Payload/runner.app + + - name: 重命名应用 + run: | + DATE=${{ steps.date.outputs.date }} + for file in app.ipa; do + new_file_name="build/Pili-${{ needs.update_version.outputs.new_version }}.ipa" + mv "$file" "$new_file_name" + done + + - name: 上传 + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + name: Pilipala-CI + path: | + build/Pili-*.ipa + + upload: + runs-on: ubuntu-latest + + needs: + - update_version + - android + - iOS + steps: + + - uses: actions/download-artifact@v3 + with: + name: Pilipala-CI + path: ./Pilipala-CI + + # - name: Upload Pre-release + # uses: ncipollo/release-action@v1 + # with: + # name: ${{ needs.update_version.outputs.new_version }} + # token: ${{ secrets.GIT_TOKEN }} + # commit: main + # tag: ${{ needs.update_version.outputs.new_version }} + # prerelease: true + # allowUpdates: true + # artifacts: Pilipala-CI/* + + - name: 发送到Telegram频道 + uses: xireiki/channel-post@main + with: + BOT_TOKEN: ${{ secrets.BOT_TOKEN }} + CHAT_ID: ${{ secrets.CHAT_ID }} + METHOD: sendMediaGroup + path: | + ./Pilipala-CI/Pili-${{ needs.update_version.outputs.new_version }}.ipa + ./Pilipala-CI/Pili-arm64-${{ needs.update_version.outputs.new_version }}.apk + ./Pilipala-CI/Pili-armeabi-v7a-${{ needs.update_version.outputs.new_version }}.apk + ./Pilipala-CI/Pili-x86_64-${{ needs.update_version.outputs.new_version }}.apk + CONTEXT: "**Pre-release:** ${{ needs.update_version.outputs.new_version }}" + PARSE_MODE: Markdown From fc2da3ce577a03fd707e512b7bbcf8706cbf4ad1 Mon Sep 17 00:00:00 2001 From: VillagerTom Date: Tue, 20 Feb 2024 13:17:44 +0800 Subject: [PATCH 02/15] =?UTF-8?q?=E4=BD=BFcheckout=20action=E5=85=8B?= =?UTF-8?q?=E9=9A=86=E6=8C=87=E5=AE=9A=E5=88=86=E6=94=AF;=20=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E4=BB=A3=E7=A0=81=E7=BC=A9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/alpha.yml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index e56fb2f94..c56c9abb8 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -66,27 +66,29 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + ref: ${{ github.ref_name }} - name: 构建Java环境 uses: actions/setup-java@v3 with: - distribution: "zulu" - java-version: "17" - token: ${{secrets.GIT_TOKEN}} + distribution: "zulu" + java-version: "17" + token: ${{secrets.GIT_TOKEN}} - name: 检查缓存 uses: actions/cache@v2 id: cache-flutter with: - path: /root/flutter-sdk - key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }} + path: /root/flutter-sdk + key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }} - name: 安装Flutter if: steps.cache-flutter.outputs.cache-hit != 'true' uses: subosito/flutter-action@v2 with: - flutter-version: 3.16.5 - channel: any + flutter-version: 3.16.5 + channel: any - name: 下载项目依赖 run: flutter pub get @@ -94,7 +96,7 @@ jobs: - name: 解码生成 jks run: echo $KEYSTORE_BASE64 | base64 -di > android/app/vvex.jks env: - KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} + KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} - name: 更新版本号 id: version @@ -105,9 +107,9 @@ jobs: - name: flutter build apk run: flutter build apk --release --split-per-abi env: - KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} - KEY_ALIAS: ${{ secrets.KEY_ALIAS }} - KEY_PASSWORD: ${{ secrets.KEY_PASSWORD}} + KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} + KEY_ALIAS: ${{ secrets.KEY_ALIAS }} + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD}} - name: 重命名应用 run: | @@ -132,7 +134,9 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 + with: + ref: ${{ github.ref_name }} - name: 安装Flutter if: steps.cache-flutter.outputs.cache-hit != 'true' From 6c20a434ed89e2b9f8ee9106131d95b8d0a98a69 Mon Sep 17 00:00:00 2001 From: VillagerTom Date: Tue, 20 Feb 2024 15:31:40 +0800 Subject: [PATCH 03/15] =?UTF-8?q?=E5=88=97=E5=87=BA=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/alpha.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index c56c9abb8..c32db6d47 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -197,6 +197,8 @@ jobs: # prerelease: true # allowUpdates: true # artifacts: Pilipala-CI/* + - name: 列出文件 + run: ls -1 ./Pilipala-CI - name: 发送到Telegram频道 uses: xireiki/channel-post@main From 381e832f3cba8da4027bbcf3acd7c0aa29c03f30 Mon Sep 17 00:00:00 2001 From: VillagerTom Date: Tue, 20 Feb 2024 15:59:34 +0800 Subject: [PATCH 04/15] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=9E=B6=E6=9E=84?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E6=8B=BC=E5=86=99=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/alpha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index c32db6d47..4d8404471 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -208,7 +208,7 @@ jobs: METHOD: sendMediaGroup path: | ./Pilipala-CI/Pili-${{ needs.update_version.outputs.new_version }}.ipa - ./Pilipala-CI/Pili-arm64-${{ needs.update_version.outputs.new_version }}.apk + ./Pilipala-CI/Pili-arm64-v8a-${{ needs.update_version.outputs.new_version }}.apk ./Pilipala-CI/Pili-armeabi-v7a-${{ needs.update_version.outputs.new_version }}.apk ./Pilipala-CI/Pili-x86_64-${{ needs.update_version.outputs.new_version }}.apk CONTEXT: "**Pre-release:** ${{ needs.update_version.outputs.new_version }}" From cfeb0588c1d8633a9c90a299b0a2976990b33816 Mon Sep 17 00:00:00 2001 From: VillagerTom Date: Tue, 20 Feb 2024 18:03:18 +0800 Subject: [PATCH 05/15] =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=8F=91=E9=80=81?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E6=9E=B6=E6=9E=84APK,=20=E5=87=8F=E5=B0=91?= =?UTF-8?q?=E5=8F=91=E9=80=81=E6=96=87=E4=BB=B6=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/alpha.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 4d8404471..6cda8d498 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -209,7 +209,7 @@ jobs: path: | ./Pilipala-CI/Pili-${{ needs.update_version.outputs.new_version }}.ipa ./Pilipala-CI/Pili-arm64-v8a-${{ needs.update_version.outputs.new_version }}.apk - ./Pilipala-CI/Pili-armeabi-v7a-${{ needs.update_version.outputs.new_version }}.apk - ./Pilipala-CI/Pili-x86_64-${{ needs.update_version.outputs.new_version }}.apk + #./Pilipala-CI/Pili-armeabi-v7a-${{ needs.update_version.outputs.new_version }}.apk + #./Pilipala-CI/Pili-x86_64-${{ needs.update_version.outputs.new_version }}.apk CONTEXT: "**Pre-release:** ${{ needs.update_version.outputs.new_version }}" PARSE_MODE: Markdown From 83ad11402fbf0840e3d1ded91854a4e9f4eef314 Mon Sep 17 00:00:00 2001 From: VillagerTom Date: Tue, 20 Feb 2024 18:52:41 +0800 Subject: [PATCH 06/15] =?UTF-8?q?=F0=9F=98=85=E6=B3=A8=E9=87=8A=E7=AC=A6?= =?UTF-8?q?=E8=A2=AB=E8=AF=86=E5=88=AB=E4=B8=BA=E6=96=87=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E7=9A=84=E4=B8=80=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/alpha.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 6cda8d498..922c6ef5f 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -209,7 +209,5 @@ jobs: path: | ./Pilipala-CI/Pili-${{ needs.update_version.outputs.new_version }}.ipa ./Pilipala-CI/Pili-arm64-v8a-${{ needs.update_version.outputs.new_version }}.apk - #./Pilipala-CI/Pili-armeabi-v7a-${{ needs.update_version.outputs.new_version }}.apk - #./Pilipala-CI/Pili-x86_64-${{ needs.update_version.outputs.new_version }}.apk CONTEXT: "**Pre-release:** ${{ needs.update_version.outputs.new_version }}" PARSE_MODE: Markdown From 3bf3fd9a46b2f42e26dd4d819116853775c62493 Mon Sep 17 00:00:00 2001 From: VillagerTom Date: Wed, 21 Feb 2024 13:03:30 +0800 Subject: [PATCH 07/15] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=8F=82=E6=95=B0`fetc?= =?UTF-8?q?h-depth:=200`=E5=8F=96=E5=BE=97=E6=89=80=E6=9C=89=E5=88=86?= =?UTF-8?q?=E6=94=AF=E5=92=8Ctags,=20=E6=9C=AB=E7=AB=AF=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=94=B9=E5=9B=9EHEAD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/alpha.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 922c6ef5f..9d0b4ed87 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -26,18 +26,19 @@ jobs: uses: actions/checkout@v4 with: ref: ${{ github.ref_name }} + fetch-depth: 0 - name: 获取first parent commit次数 id: get-first-parent-commit-count run: | version=$(yq e .version pubspec.yaml | cut -d "+" -f 1) - git fetch origin "refs/tags/*:refs/tags/*" recent_release_tag=$(git tag -l | grep $version | egrep -v "[-|+]" || true) if [[ "x$recent_release_tag" == "x" ]]; then echo "当前版本tag不存在,请手动生成tag." exit 1 fi - first_parent_commit_count=$(git rev-list --first-parent --count $recent_release_tag..FETCH_HEAD) + git log --oneline --first-parent $recent_release_tag..HEAD + first_parent_commit_count=$(git rev-list --first-parent --count $recent_release_tag..HEAD) echo "count=$first_parent_commit_count" >> $GITHUB_OUTPUT - name: 更新版本号 From 95bc4a9f468ace6a088a6e4c9a7bf7b3568c398a Mon Sep 17 00:00:00 2001 From: VillagerTom Date: Wed, 21 Feb 2024 16:05:57 +0800 Subject: [PATCH 08/15] =?UTF-8?q?=E5=9C=A8Telegram=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E4=B8=AD=E6=98=BE=E7=A4=BA=E6=9C=80=E5=90=8E=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/alpha.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 9d0b4ed87..81c8e611e 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -20,6 +20,7 @@ jobs: outputs: # 定义输出变量 version,以便在其他job中引用 new_version: ${{ steps.version.outputs.new_version }} + last_commit: ${{ steps.get-last-commit.outputs.last_commit }} steps: - name: Checkout code @@ -41,6 +42,12 @@ jobs: first_parent_commit_count=$(git rev-list --first-parent --count $recent_release_tag..HEAD) echo "count=$first_parent_commit_count" >> $GITHUB_OUTPUT + - name: 获取最后一次提交 + id: get-last-commit + run: | + last_commit=$(git log -1 --pretty="%h %B" --first-parent) + echo "last_commit=$last_commit" >> $GITHUB_OUTPUT + - name: 更新版本号 id: version run: | @@ -210,5 +217,6 @@ jobs: path: | ./Pilipala-CI/Pili-${{ needs.update_version.outputs.new_version }}.ipa ./Pilipala-CI/Pili-arm64-v8a-${{ needs.update_version.outputs.new_version }}.apk - CONTEXT: "**Pre-release:** ${{ needs.update_version.outputs.new_version }}" + CONTEXT: "**Pre-release: ${{ needs.update_version.outputs.new_version }}**\n${{ needs.update_version.outputs.last_commit }}" + PARSE_MODE: Markdown From 40cc4e0dd1470323aa2ec6da231d8a7e497ea65a Mon Sep 17 00:00:00 2001 From: VillagerTom Date: Wed, 21 Feb 2024 17:29:59 +0800 Subject: [PATCH 09/15] =?UTF-8?q?channel-post@v1.0.5=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E5=8F=91=E9=80=81=E6=96=87=E4=BB=B6=EF=BC=8C=E6=94=B9=E4=B8=BA?= =?UTF-8?q?v1.0.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/alpha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 81c8e611e..ae207a440 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -209,7 +209,7 @@ jobs: run: ls -1 ./Pilipala-CI - name: 发送到Telegram频道 - uses: xireiki/channel-post@main + uses: xireiki/channel-post@v1.0.4 with: BOT_TOKEN: ${{ secrets.BOT_TOKEN }} CHAT_ID: ${{ secrets.CHAT_ID }} From 04186cdd5b8484eedd086f54b6a8464dca8bffcd Mon Sep 17 00:00:00 2001 From: VillagerTom Date: Wed, 21 Feb 2024 23:53:23 +0800 Subject: [PATCH 10/15] =?UTF-8?q?=E5=B0=86alpha.yml=E7=9A=84workflow=20nam?= =?UTF-8?q?e=E6=94=B9=E4=B8=BAalpha,=20=E9=81=BF=E5=85=8D=E6=B7=B7?= =?UTF-8?q?=E6=B7=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/alpha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index ae207a440..3cdc4fd59 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -1,4 +1,4 @@ -name: CI +name: alpha on: workflow_dispatch: From 4642c2a8472e41e4443d69eb829c901d9a1a3cad Mon Sep 17 00:00:00 2001 From: VillagerTom Date: Wed, 21 Feb 2024 23:55:50 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E5=B0=86git=20log=20pretty=20format?= =?UTF-8?q?=E4=B8=ADraw=20body=E6=9B=BF=E6=8D=A2=E4=B8=BAsubject,=20?= =?UTF-8?q?=E9=81=BF=E5=85=8Drevert=20commit=E5=A4=9A=E8=A1=8C=E8=BE=93?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/alpha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 3cdc4fd59..e44bd262c 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -45,7 +45,7 @@ jobs: - name: 获取最后一次提交 id: get-last-commit run: | - last_commit=$(git log -1 --pretty="%h %B" --first-parent) + last_commit=$(git log -1 --pretty="%h %s" --first-parent) echo "last_commit=$last_commit" >> $GITHUB_OUTPUT - name: 更新版本号 From 65d2bfd844e5019cd3655266063e0514ee82a561 Mon Sep 17 00:00:00 2001 From: VillagerTom Date: Sat, 24 Feb 2024 22:10:08 +0800 Subject: [PATCH 12/15] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E8=87=B3channel-post@v?= =?UTF-8?q?1.0.7,=20=E6=94=AF=E6=8C=81=E4=BC=A0=E8=BE=93=E5=A4=A7=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/alpha.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index e44bd262c..c22f25c9b 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -205,18 +205,16 @@ jobs: # prerelease: true # allowUpdates: true # artifacts: Pilipala-CI/* - - name: 列出文件 - run: ls -1 ./Pilipala-CI - name: 发送到Telegram频道 - uses: xireiki/channel-post@v1.0.4 + uses: xireiki/channel-post@v1.0.7 with: - BOT_TOKEN: ${{ secrets.BOT_TOKEN }} - CHAT_ID: ${{ secrets.CHAT_ID }} - METHOD: sendMediaGroup - path: | - ./Pilipala-CI/Pili-${{ needs.update_version.outputs.new_version }}.ipa - ./Pilipala-CI/Pili-arm64-v8a-${{ needs.update_version.outputs.new_version }}.apk - CONTEXT: "**Pre-release: ${{ needs.update_version.outputs.new_version }}**\n${{ needs.update_version.outputs.last_commit }}" - - PARSE_MODE: Markdown + bot_token: ${{ secrets.BOT_TOKEN }} + chat_id: ${{ secrets.CHAT_ID }} + large_file: true + api_id: ${{ secrets.TELEGRAM_API_ID }} + api_hash: ${{ secrets.TELEGRAM_API_HASH }} + method: sendFile + path: Pilipala-CI/* + parse_mode: Markdown + context: "**Pre-release: ${{ needs.update_version.outputs.new_version }}**\n${{ needs.update_version.outputs.last_commit }}" From 3f9fcabc2d7058fb21cbba9a69cace34e18a3985 Mon Sep 17 00:00:00 2001 From: VillagerTom Date: Wed, 28 Feb 2024 15:36:30 +0800 Subject: [PATCH 13/15] =?UTF-8?q?Revert=20"=E5=B0=86alpha.yml=E7=9A=84work?= =?UTF-8?q?flow=20name=E6=94=B9=E4=B8=BAalpha,=20=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E6=B7=B7=E6=B7=86"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 04186cdd5b8484eedd086f54b6a8464dca8bffcd. --- .github/workflows/alpha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index c22f25c9b..af155cc98 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -1,4 +1,4 @@ -name: alpha +name: CI on: workflow_dispatch: From 45cc46d6d6316eacadd69e40b1840814e4153cc9 Mon Sep 17 00:00:00 2001 From: VillagerTom Date: Wed, 28 Feb 2024 15:38:17 +0800 Subject: [PATCH 14/15] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=EF=BC=9A.gith?= =?UTF-8?q?ub/workflows/alpha.yml=20->=20.github/workflows/CI.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/{alpha.yml => CI.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{alpha.yml => CI.yml} (100%) diff --git a/.github/workflows/alpha.yml b/.github/workflows/CI.yml similarity index 100% rename from .github/workflows/alpha.yml rename to .github/workflows/CI.yml From 699be4125bc1265aee15d3820506369c7a463f0a Mon Sep 17 00:00:00 2001 From: VillagerTom Date: Wed, 28 Feb 2024 16:22:14 +0800 Subject: [PATCH 15/15] =?UTF-8?q?=E5=B0=86=E7=89=88=E6=9C=AC=E5=8F=B7?= =?UTF-8?q?=E4=B8=AD=E7=9A=84alpha=E6=94=B9=E4=B8=BAbeta;=20=E5=8A=A0?= =?UTF-8?q?=E5=9B=9E=E4=B9=8B=E5=89=8D=E5=88=A0=E5=8E=BB=E7=9A=84=E2=80=9C?= =?UTF-8?q?v=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CI.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index af155cc98..231c61f50 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: branches: - - 'alpha' + - 'main' paths-ignore: - '**.md' - '**.txt' @@ -58,7 +58,7 @@ jobs: #RUN_NUMBER=${{ github.run_number }} # 构建新版本号 - NEW_VERSION=$VERSION-alpha.${{ steps.get-first-parent-commit-count.outputs.count }} + NEW_VERSION=$VERSION-beta.${{ steps.get-first-parent-commit-count.outputs.count }} # 输出新版本号 echo "New version: $NEW_VERSION" @@ -123,7 +123,7 @@ jobs: run: | for file in build/app/outputs/flutter-apk/app-*.apk; do if [[ $file =~ app-(.?*)release.apk ]]; then - new_file_name="build/app/outputs/flutter-apk/Pili-${BASH_REMATCH[1]}${{ needs.update_version.outputs.new_version }}.apk" + new_file_name="build/app/outputs/flutter-apk/Pili-${BASH_REMATCH[1]}v${{ needs.update_version.outputs.new_version }}.apk" mv "$file" "$new_file_name" fi done @@ -169,7 +169,7 @@ jobs: run: | DATE=${{ steps.date.outputs.date }} for file in app.ipa; do - new_file_name="build/Pili-${{ needs.update_version.outputs.new_version }}.ipa" + new_file_name="build/Pili-v${{ needs.update_version.outputs.new_version }}.ipa" mv "$file" "$new_file_name" done @@ -217,4 +217,4 @@ jobs: method: sendFile path: Pilipala-CI/* parse_mode: Markdown - context: "**Pre-release: ${{ needs.update_version.outputs.new_version }}**\n${{ needs.update_version.outputs.last_commit }}" + context: "*Pre-release: v${{ needs.update_version.outputs.new_version }}*\n${{ needs.update_version.outputs.last_commit }}"