From 16491ce73c7259ab1a288724bf2ccddadee0f183 Mon Sep 17 00:00:00 2001 From: yaobiao131 <28655758+yaobiao131@users.noreply.github.com> Date: Tue, 5 Aug 2025 23:46:55 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20ci=E5=8F=91=E5=B8=83=E5=A2=9E=E5=8A=A0win?= =?UTF-8?q?dows=20trimmed=E5=B9=B6=E4=BC=98=E5=8C=96macos=E7=AD=BE?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 24 +++++++- script/macos/package.sh | 4 +- script/macos/sign.sh | 10 ++-- script/pupnet/DownKyi.pupnet.trimmed.conf | 72 +++++++++++++++++++++++ 4 files changed, 102 insertions(+), 8 deletions(-) create mode 100644 script/pupnet/DownKyi.pupnet.trimmed.conf diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6d6d872..2d36baa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,6 +36,7 @@ jobs: matrix: cpu: [ x64, x86 ] kind: [ zip ] + trimmed: [ true, false ] steps: - name: Checkout uses: actions/checkout@v4 @@ -57,21 +58,42 @@ jobs: .\aria2.ps1 ${{ matrix.cpu }} working-directory: ./script - name: Package + if: ${{ matrix.trimmed == false }} run: | pupnet DownKyi.pupnet.conf --app-version ${{ steps.version.outputs.content }} --kind ${{ matrix.kind }} -r win-${{ matrix.cpu }} -y working-directory: ./script/pupnet + - name: Package trimmed + if: ${{ matrix.trimmed == true }} + run: | + pupnet DownKyi.pupnet.trimmed.conf --app-version ${{ steps.version.outputs.content }} --kind ${{ matrix.kind }} -r win-${{ matrix.cpu }} -y + mv output/DownKyi-${{ steps.version.outputs.content }}-1.win-${{ matrix.cpu }}.${{ matrix.kind }} output/DownKyi-${{ steps.version.outputs.content }}-1.win-${{ matrix.cpu }}-trimmed.${{ matrix.kind }} + working-directory: ./script/pupnet - name: Upload build artifacts ${{ matrix.kind }} uses: actions/upload-artifact@v4 + if: ${{ matrix.trimmed == false }} with: name: DownKyi-${{ steps.version.outputs.content }}-1.win-${{ matrix.cpu }}.${{ matrix.kind }} path: script/pupnet/output/DownKyi-${{ steps.version.outputs.content }}-1.win-${{ matrix.cpu }}.${{ matrix.kind }} + - name: Upload build artifacts ${{ matrix.kind }} trimmed + uses: actions/upload-artifact@v4 + if: ${{ matrix.trimmed == true }} + with: + name: DownKyi-${{ steps.version.outputs.content }}-1.win-${{ matrix.cpu }}-trimmed.${{ matrix.kind }} + path: script/pupnet/output/DownKyi-${{ steps.version.outputs.content }}-1.win-${{ matrix.cpu }}-trimmed.${{ matrix.kind }} - name: Release uses: ncipollo/release-action@v1 - if: ${{ startsWith(github.ref, 'refs/tags/') }} + if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.trimmed == false }} with: allowUpdates: true artifacts: script/pupnet/output/DownKyi-${{ steps.version.outputs.content }}-1.win-${{ matrix.cpu }}.${{ matrix.kind }} body: ${{ needs.changelog.outputs.release_body }} + - name: Release trimmed + uses: ncipollo/release-action@v1 + if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.trimmed == true }} + with: + allowUpdates: true + artifacts: script/pupnet/output/DownKyi-${{ steps.version.outputs.content }}-1.win-${{ matrix.cpu }}-trimmed.${{ matrix.kind }} + body: ${{ needs.changelog.outputs.release_body }} build-linux: runs-on: ubuntu-22.04 needs: changelog diff --git a/script/macos/package.sh b/script/macos/package.sh index 96a6bd2..f61c256 100644 --- a/script/macos/package.sh +++ b/script/macos/package.sh @@ -22,6 +22,6 @@ cp -a "$PUBLISH_OUTPUT_DIRECTORY" "$APP_NAME/Contents/MacOS" if [ ! -x $APP_NAME/Contents/MacOS/aria2/aria2c ]; then chmod +x $APP_NAME/Contents/MacOS/aria2/aria2c fi -if [ ! -x $APP_NAME/Contents/MacOS/aria2/aria2c ]; then - chmod +x $APP_NAME/Contents/MacOS/aria2/aria2c +if [ ! -x $APP_NAME/Contents/MacOS/ffmpeg/ffmpeg ]; then + chmod +x $APP_NAME/Contents/MacOS/ffmpeg/ffmpeg fi diff --git a/script/macos/sign.sh b/script/macos/sign.sh index 28b1a68..a5032a6 100644 --- a/script/macos/sign.sh +++ b/script/macos/sign.sh @@ -3,13 +3,13 @@ APP_NAME="哔哩下载姬.app" ENTITLEMENTS="DownKyi.entitlements" SIGNING_IDENTITY="biao yao" # matches Keychain Access certificate name -find "$APP_NAME/Contents/MacOS/" | while read fname; do - if [[ -f $fname ]]; then - echo "[INFO] Signing $fname" - codesign --force --timestamp --options=runtime --entitlements "$ENTITLEMENTS" --sign "$SIGNING_IDENTITY" "$fname" +find "$APP_NAME/Contents/MacOS/" -type f | while read -r file; do + if file "$file" | grep -q "Mach-O"; then + echo "[INFO] Signing $file" + codesign --force --timestamp --options=runtime --entitlements "$ENTITLEMENTS" --sign "$SIGNING_IDENTITY" "$file" fi done echo "[INFO] Signing app file" -codesign --force --timestamp --options=runtime --entitlements "$ENTITLEMENTS" --sign "$SIGNING_IDENTITY" "$APP_NAME" +codesign --deep --force --timestamp --options=runtime --entitlements "$ENTITLEMENTS" --sign "$SIGNING_IDENTITY" "$APP_NAME" diff --git a/script/pupnet/DownKyi.pupnet.trimmed.conf b/script/pupnet/DownKyi.pupnet.trimmed.conf new file mode 100644 index 0000000..e06e86e --- /dev/null +++ b/script/pupnet/DownKyi.pupnet.trimmed.conf @@ -0,0 +1,72 @@ +AppBaseName = DownKyi +AppFriendlyName = 哔哩下载姬 +AppId = cn.bzdrs.downkyi +AppVersionRelease = ${APP_VERSION} +AppShortSummary = 哔哩下载姬,哔哩哔哩网站视频下载工具,支持批量下载,支持8K、HDR、杜比视界,提供工具箱(音视频提取、去水印等) + +AppLicenseId = GPL-3.0-or-later +AppLicenseFile = ../../LICENSE + +IconFiles = """ + icons/logo.icns + icons/logo.16.png + icons/logo.32.png + icons/logo.64.png + icons/logo.128.png + icons/logo.256.png + icons/logo.512.png + icons/logo.1024.png +""" +DesktopFile = app.desktop +# PUBLISHER +PublisherName = yaobiao131 +PublisherCopyright = Copyright (C) yaobiao131 2024 +PublisherLinkName = Home Page +PublisherLinkUrl = https://github.com/yaobiao131/downkyicore +PublisherEmail = 28655758+yaobiao131@users.noreply.github.com +DotnetProjectPath = ../../ + +DesktopNoDisplay = false +DesktopTerminal = false + +# Package Out +OutputDirectory = output/ +PackageName = DownKyi +PrimeCategory = Utility + +# AppImage +AppImageVersionOutput = true + +DebianRecommends = """ + libc6 + libgcc1 + libgcc-s1 + libgssapi-krb5-2 + libicu + libssl + libstdc++6 + libunwind + zlib1g +""" + +# FLATPAK OPTIONS +FlatpakPlatformRuntime = org.freedesktop.Platform +FlatpakPlatformSdk = org.freedesktop.Sdk +FlatpakPlatformVersion = 22.08 +; FlatpakFinishArgs = """ +; --socket=wayland +; --socket=x11 +; --filesystem=host +; --share=network +; """ +; FlatpakBuilderArgs = + +DotnetPublishArgs = -p:Version=${APP_VERSION} --self-contained true -p:DebugType=None -p:DebugSymbols=false -p:PublishProfile=trimmed + +# WINDOWS SETUP OPTIONS +SetupAdminInstall = true +SetupCommandPrompt = PupNet Console +SetupMinWindowsVersion = 6.1sp1 +SetupSignTool = +SetupSuffixOutput = +SetupVersionOutput = true \ No newline at end of file