release.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. name: Release
  2. on:
  3. push:
  4. release:
  5. branches: [main]
  6. types:
  7. - published
  8. paths-ignore:
  9. - "**.md"
  10. - "**.spec.js"
  11. - ".idea"
  12. - ".vscode"
  13. - ".dockerignore"
  14. - "Dockerfile"
  15. - ".gitignore"
  16. - ".github/**"
  17. - "!.github/workflows/release.yml"
  18. defaults:
  19. run:
  20. shell: "bash"
  21. jobs:
  22. build:
  23. # see more environment https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
  24. runs-on: [ubuntu-20.04]
  25. # https://www.electron.build/multi-platform-build#provided-docker-images
  26. container: electronuserland/builder:wine
  27. env:
  28. GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  29. ELECTRON_BUILDER_CACHE: "/root/.cache/electron-builder"
  30. ELECTRON_CACHE: "/root/.cache/electron"
  31. strategy:
  32. matrix:
  33. node: ["14"]
  34. steps:
  35. - uses: actions/checkout@v2
  36. with:
  37. fetch-depth: 0
  38. - name: Use Node.js ${{ matrix.node }}
  39. uses: actions/setup-node@v2
  40. with:
  41. node-version: ${{ matrix.node }}
  42. - name: Install dependencies
  43. run: npm ci
  44. # - name: Run tests
  45. # run: npm run test
  46. # - name: Build dependencies
  47. # run: npm run build
  48. # env:
  49. # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  50. # - uses: actions/upload-artifact@v2
  51. # with:
  52. # name: upload-artifact
  53. # path: |
  54. # release/electron-vue-vite*.exe
  55. # release/electron-vue-vite*.AppImage
  56. # release/electron-vue-vite*.snap
  57. # https://github.com/marketplace/actions/electron-builder-action
  58. - name: Compile & Release Electron app
  59. uses: samuelmeuli/action-electron-builder@v1
  60. with:
  61. build_script_name: prebuild
  62. args: --config electron-builder.json5
  63. github_token: ${{ secrets.GITHUB_TOKEN }}
  64. release: ${{ startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push' && needs.get_metadata.outputs.branch == 'main'}}
  65. max_attempts: 3