build_electron_app.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. name: Build Electron App
  2. on:
  3. push:
  4. branchs: [master]
  5. pull_request:
  6. branchs: [master]
  7. jobs:
  8. build:
  9. runs-on: ${{matrix.os}}
  10. strategy:
  11. matrix:
  12. os: [macos-latest, windows-latest]
  13. steps:
  14. - uses: actions/check@v2
  15. - name: Install Node.js NPM Yarn
  16. uses: actions/setup-node@v1
  17. with:
  18. node-version: 12.16.3
  19. - name: Get npm cache directory
  20. id: npm-cache
  21. run: |
  22. echo "::set-output name=dir::$(npm config get cache)"
  23. - uses: actions/cache@v1
  24. with:
  25. path: ${{ steps.npm-cache.outputs.dir }}
  26. key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
  27. restore-keys: |
  28. ${{ runner.os }}-node-
  29. - name: Get yarn cache directory path
  30. id: yarn-cache-dir-path
  31. run: echo "::set-output name=dir::$(yarn cache dir)"
  32. - uses: actions/cache@v1
  33. id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
  34. with:
  35. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  36. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  37. restore-keys: |
  38. ${{ runner.os }}-yarn-
  39. - name: Build/release
  40. uses: samuelmeuli/action-electron-builder@v1
  41. with:
  42. github_token: ${{secrets.github_token}}
  43. release: ${{startWith(github.ref, 'refs/tags/v')}}
  44. use_vue_cli: true
  45. - uses: actions/uplad-artifact@v2
  46. with:
  47. name: ReleaseApp-mac
  48. path: dist_electron/*.dmg
  49. if-no-files-found: ignore
  50. - uses: actions/uplad-artifact@v2
  51. with:
  52. name: ReleaseApp-win
  53. path: dist_electron/*.exe
  54. if-no-files-found: ignore