autobuild.yml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. name: 打包
  2. on:
  3. workflow_dispatch:
  4. jobs:
  5. build-windows:
  6. runs-on: windows-latest
  7. steps:
  8. - uses: actions/checkout@v4
  9. - uses: actions/setup-node@v4
  10. with:
  11. node-version: 18
  12. - run: echo (node -p -e '`VERSION=${require("./package.json").version}`') >> $Env:GITHUB_ENV
  13. - run: npm install
  14. - run: npm run package
  15. - uses: maotoumao/inno-setup-action-cli@main
  16. with:
  17. filepath: ./release/build-windows.iss
  18. variables: /DMyAppVersion=${{ env.VERSION }} /DMyAppId=${{ secrets.MYAPPID }}
  19. - name: Upload Setup
  20. uses: actions/upload-artifact@v4
  21. with:
  22. name: windows-release
  23. path: ./out/MusicFreeSetup.exe
  24. - name: Generate Portable
  25. run: mkdir ./out/MusicFree-win32-x64/portable
  26. - uses: vimtor/action-zip@v1.1
  27. with:
  28. files: ./out/MusicFree-win32-x64
  29. dest: MusicFree-win32-x64-portable.zip
  30. - name: Upload Portable
  31. uses: actions/upload-artifact@v4
  32. with:
  33. name: windows-portable-release
  34. path: ${{ github.workspace }}/MusicFree-win32-x64-portable.zip
  35. build-windows-legacy:
  36. runs-on: windows-latest
  37. steps:
  38. - uses: actions/checkout@v4
  39. - uses: actions/setup-node@v4
  40. with:
  41. node-version: 18
  42. - run: echo (node -p -e '`VERSION=${require("./package.json").version}`') >> $Env:GITHUB_ENV
  43. - run: npm install
  44. - run: npm install electron@22
  45. - run: npm run package
  46. - uses: maotoumao/inno-setup-action-cli@main
  47. with:
  48. filepath: ./release/build-windows.iss
  49. variables: /DMyAppVersion=${{ env.VERSION }} /DMyAppId=${{ secrets.MYAPPID }}
  50. - name: Upload Setup
  51. uses: actions/upload-artifact@v4
  52. with:
  53. name: windows-legacy-release
  54. path: ./out/MusicFreeSetup.exe
  55. - name: Generate Portable
  56. run: mkdir ./out/MusicFree-win32-x64/portable
  57. - uses: vimtor/action-zip@v1.1
  58. with:
  59. files: ./out/MusicFree-win32-x64
  60. dest: MusicFree-win32-x64-legacy-portable.zip
  61. - name: Upload Portable
  62. uses: actions/upload-artifact@v4
  63. with:
  64. name: windows-legacy-portable-release
  65. path: ${{ github.workspace }}/MusicFree-win32-x64-legacy-portable.zip
  66. build-macos-x64:
  67. runs-on: macos-13
  68. steps:
  69. - uses: actions/checkout@v4
  70. - uses: actions/setup-python@v4
  71. with:
  72. python-version: '3.10'
  73. - uses: actions/setup-node@v4
  74. with:
  75. node-version: 18
  76. - run: node -p -e '`VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
  77. - run: npm install
  78. - run: npm run make
  79. - run: ls ./out/make
  80. - name: Upload Setup
  81. uses: actions/upload-artifact@v4
  82. with:
  83. name: macos-x64-dmg-release
  84. path: ./out/make/MusicFree-${{ env.VERSION }}-x64.dmg
  85. build-macos-arm64:
  86. runs-on: macos-latest
  87. steps:
  88. - uses: actions/checkout@v4
  89. - uses: actions/setup-python@v4
  90. with:
  91. python-version: '3.10'
  92. - uses: actions/setup-node@v4
  93. with:
  94. node-version: 18
  95. - run: node -p -e '`VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
  96. - run: npm install
  97. - run: npm run make -- --arch="arm64"
  98. - name: Upload Setup
  99. uses: actions/upload-artifact@v4
  100. with:
  101. name: macos-arm64-dmg-release
  102. path: ./out/make/MusicFree-${{ env.VERSION }}-arm64.dmg
  103. build-ubuntu:
  104. runs-on: ubuntu-latest
  105. steps:
  106. - uses: actions/checkout@v4
  107. - uses: actions/setup-node@v4
  108. with:
  109. node-version: 18
  110. - run: node -p -e '`VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
  111. - run: npm install
  112. - run: npm run make
  113. - name: Upload Setup
  114. uses: actions/upload-artifact@v4
  115. with:
  116. name: ubuntu-release
  117. path: ./out/make/deb/x64/