test-desktop-release.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. name: Test Desktop Release (Manual)
  2. on:
  3. workflow_dispatch: # Manual trigger for testing
  4. env:
  5. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  6. jobs:
  7. create-test-release:
  8. name: Create Test Release
  9. runs-on: ubuntu-latest
  10. outputs:
  11. release-tag: ${{ steps.get-version.outputs.tag }}
  12. steps:
  13. - uses: actions/checkout@v4
  14. - name: Get version for test
  15. id: get-version
  16. run: |
  17. VERSION=$(node -p "require('./desktop-app/package.json').version")
  18. TIMESTAMP=$(date +%Y%m%d-%H%M%S)
  19. TAG="test-v${VERSION}-${TIMESTAMP}"
  20. echo "tag=${TAG}" >> $GITHUB_OUTPUT
  21. - name: Create Test Release
  22. uses: actions/create-release@v1
  23. env:
  24. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  25. with:
  26. tag_name: ${{ steps.get-version.outputs.tag }}
  27. release_name: 🧪 Test Release - kNotes Desktop v1.1.0
  28. body: |
  29. ## 🧪 Test Release - Desktop App Cross-Platform Build
  30. This is a **test release** to verify the cross-platform build system works correctly.
  31. ### What gets built:
  32. - 🐧 **Linux**: `.AppImage` file (portable, runs on any Linux distro)
  33. - 🪟 **Windows**: `.exe` installer (NSIS-based installer)
  34. - 🍎 **macOS**: `.dmg` installer (drag-and-drop installer)
  35. ### Test Status:
  36. - ✅ GitHub Actions workflow
  37. - ✅ electron-builder configuration
  38. - ✅ Cross-platform publishing
  39. - ✅ Auto-updater integration
  40. **Built from**: ${{ github.sha }}
  41. **Timestamp**: ${{ steps.get-version.outputs.tag }}
  42. draft: false
  43. prerelease: true
  44. test-linux:
  45. name: Test Linux Build
  46. needs: create-test-release
  47. runs-on: ubuntu-latest
  48. steps:
  49. - uses: actions/checkout@v4
  50. - name: Setup Node.js
  51. uses: actions/setup-node@v4
  52. with:
  53. node-version: '18'
  54. cache: 'npm'
  55. cache-dependency-path: desktop-app/package-lock.json
  56. - name: Copy frontend files
  57. run: |
  58. cp -r src/main/resources/static/* desktop-app/
  59. - name: Install dependencies
  60. run: |
  61. cd desktop-app
  62. npm ci
  63. - name: Build Linux (test)
  64. env:
  65. GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  66. run: |
  67. cd desktop-app
  68. npm run publish-linux
  69. test-windows:
  70. name: Test Windows Build
  71. needs: create-test-release
  72. runs-on: windows-latest
  73. steps:
  74. - uses: actions/checkout@v4
  75. - name: Setup Node.js
  76. uses: actions/setup-node@v4
  77. with:
  78. node-version: '18'
  79. cache: 'npm'
  80. cache-dependency-path: desktop-app/package-lock.json
  81. - name: Copy frontend files
  82. run: |
  83. xcopy "src\main\resources\static\*" "desktop-app\" /E /I /Y
  84. - name: Install dependencies
  85. run: |
  86. cd desktop-app
  87. npm ci
  88. - name: Build Windows (test)
  89. env:
  90. GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  91. run: |
  92. cd desktop-app
  93. npm run publish-win
  94. test-macos:
  95. name: Test macOS Build
  96. needs: create-test-release
  97. runs-on: macos-latest
  98. steps:
  99. - uses: actions/checkout@v4
  100. - name: Setup Node.js
  101. uses: actions/setup-node@v4
  102. with:
  103. node-version: '18'
  104. cache: 'npm'
  105. cache-dependency-path: desktop-app/package-lock.json
  106. - name: Copy frontend files
  107. run: |
  108. cp -r src/main/resources/static/* desktop-app/
  109. - name: Install dependencies
  110. run: |
  111. cd desktop-app
  112. npm ci
  113. - name: Build macOS (test)
  114. env:
  115. GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  116. run: |
  117. cd desktop-app
  118. npm run publish-mac