build: update version to 1.3.0-Beta and refine ProGuard configuration #48
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Desktop Apps | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: [ "v*" ] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-macos-arm64: | |
| name: Build MacOS (Apple Silicon) | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build MacOS DMG (Apple Silicon) | |
| # 执行 Compose Desktop 的打包任务 | |
| run: ./gradlew :composeApp:packageReleaseDmg --no-configuration-cache | |
| env: | |
| REPORT_API_SECRET: ${{ secrets.REPORT_API_SECRET }} | |
| REPORT_URL: ${{ secrets.REPORT_URL }} | |
| - name: Upload DMG Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: MacOS-App-DMG-arm64 | |
| # 上传生成的 DMG 文件 | |
| path: composeApp/build/compose/binaries/**/*.dmg | |
| if-no-files-found: error | |
| build-macos-x64: | |
| name: Build MacOS (Intel) | |
| runs-on: macos-15-intel | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build MacOS DMG (Intel) | |
| # 执行 Compose Desktop 的打包任务 | |
| run: ./gradlew :composeApp:packageReleaseDmg | |
| env: | |
| REPORT_API_SECRET: ${{ secrets.REPORT_API_SECRET }} | |
| REPORT_URL: ${{ secrets.REPORT_URL }} | |
| - name: Upload DMG Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: MacOS-App-DMG-amd64 | |
| # 上传生成的 DMG 文件 | |
| path: composeApp/build/compose/binaries/**/*.dmg | |
| if-no-files-found: error | |
| build-linux-deb-x64: | |
| name: Build Linux Deb (x64) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Install Linux Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y fakeroot | |
| - name: Build Linux Deb | |
| # 执行 Compose Desktop 的打包任务 | |
| run: ./gradlew :composeApp:packageReleaseDeb | |
| env: | |
| REPORT_API_SECRET: ${{ secrets.REPORT_API_SECRET }} | |
| REPORT_URL: ${{ secrets.REPORT_URL }} | |
| - name: Upload Deb Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Linux-App-Deb-x64 | |
| # 上传生成的 Deb 文件 | |
| path: composeApp/build/compose/binaries/**/*.deb | |
| if-no-files-found: error | |
| build-windows-x64: | |
| name: Build Windows (x64) | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| - name: Create Release Distributable | |
| run: ./gradlew :composeApp:createReleaseDistributable --no-configuration-cache | |
| env: | |
| REPORT_API_SECRET: ${{ secrets.REPORT_API_SECRET }} | |
| REPORT_URL: ${{ secrets.REPORT_URL }} | |
| - name: Setup Inno Setup | |
| run: | | |
| choco install innosetup | |
| - name: Extract App Version | |
| shell: powershell | |
| run: | | |
| $content = Get-Content composeApp/build.gradle.kts | |
| $versionLine = $content | Select-String 'val appVersion = "(.*)"' | |
| if ($versionLine) { | |
| $version = $versionLine.Matches.Groups[1].Value | |
| echo "APP_VERSION=$version" >> $env:GITHUB_ENV | |
| } else { | |
| Write-Error "Could not find appVersion in build.gradle.kts" | |
| exit 1 | |
| } | |
| - name: Build Installer with Inno Setup | |
| # 显式传入 amd64 架构参数和版本号 | |
| run: iscc /DMyAppArch=amd64 /DMyAppVersion=${{ env.APP_VERSION }} installer/setup.iss | |
| - name: Upload Windows Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Windows-App-Exe-amd64 | |
| path: installer/*_amd64_*.exe | |
| if-no-files-found: error | |
| # build-windows-arm64: | |
| # name: Build Windows (ARM64) | |
| # runs-on: windows-latest # 注意:目前 GitHub Hosted Runner 主要是 x64,这里生成的包可能仍然包含 x64 JVM,除非手动配置交叉编译 | |
| # | |
| # steps: | |
| # - name: Checkout code | |
| # uses: actions/checkout@v4 | |
| # | |
| # - name: Set up JDK 17 | |
| # uses: actions/setup-java@v4 | |
| # with: | |
| # java-version: '17' | |
| # distribution: 'temurin' | |
| # | |
| # - name: Setup Gradle | |
| # uses: gradle/actions/setup-gradle@v3 | |
| # | |
| # - name: Create Release Distributable | |
| # run: ./gradlew :composeApp:createReleaseDistributable | |
| # | |
| # - name: Setup Inno Setup | |
| # run: | | |
| # choco install innosetup | |
| # | |
| # - name: Build Installer with Inno Setup | |
| # # 显式传入 aarch64 架构参数,这将影响生成的安装包文件名 | |
| # run: iscc /DMyAppArch=aarch64 installer/setup.iss | |
| # | |
| # - name: Upload Windows Artifact | |
| # uses: actions/upload-artifact@v4 | |
| # with: | |
| # name: Windows-App-Exe-arm64 | |
| # path: installer/*_aarch64_*.exe | |
| # if-no-files-found: error | |
| release: | |
| name: Create Release | |
| needs: [build-macos-arm64, build-macos-x64, build-linux-deb-x64, build-windows-x64] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Display structure of downloaded files | |
| run: ls -R artifacts | |
| - name: Generate Release Body | |
| id: release_body | |
| shell: bash | |
| run: | | |
| # Define common release notes | |
| NOTES="1.新增使用 NAS 登录和 FN Connect 中继访问的支持 | |
| 2.修复电视节目切换下一集后快捷键失效的问题 | |
| 3.优化登录界面 UI 及代码逻辑 | |
| 感谢以下飞牛共建团成员反馈问题并协助排查: | |
| @[玉尺书生](https://club.fnnas.com/home.php?mod=space&uid=6482) | |
| > **当前应用中没有展示出来或者点击没有反应的就是还没做的功能,后面陆续都会实现,请仅对已实现的功能提出合理意见,感谢理解** | |
| " | |
| # Define warning for Alpha versions | |
| WARNING="" | |
| if [[ "${{ github.ref }}" =~ [Aa]lpha ]]; then | |
| WARNING=" | |
| > **此版本为开发中的版本,请酌情下载安装。** | |
| " | |
| fi | |
| # Output to GITHUB_ENV | |
| { | |
| echo "RELEASE_BODY<<EOF" | |
| echo "$NOTES" | |
| echo "$WARNING" | |
| echo "EOF" | |
| } >> $GITHUB_ENV | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: artifacts/**/* | |
| # 如果 tag 包含 '-' (如 v1.0.0-alpha),则标记为预发布 (Pre-release) | |
| prerelease: ${{ contains(github.ref, '-') }} | |
| draft: false | |
| body: | | |
| ${{ env.RELEASE_BODY }} | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |