当前位置:   article > 正文

GitHub Action + Release:打造 Electron 持续交付系统文件配置_electron action create-release

electron action create-release

 main.yml上的文件配置

  1. # This is a basic workflow to help you get started with Actions
  2. name: build Electron App For Win/Mac
  3. # Controls when the action will run. Triggers the workflow on push or pull request
  4. # events but only for the master branch
  5. on:
  6. push:
  7. tags:
  8. - "v1.0.7"
  9. # A workflow run is made up of one or more jobs that can run sequentially or in parallel
  10. jobs:
  11. # job's id
  12. release:
  13. # job's name
  14. name: build and release electron app
  15. # the type of machine to run the job on
  16. runs-on: ${{ matrix.os }}
  17. # create a build matrix for jobs
  18. strategy:
  19. fail-fast: false
  20. matrix:
  21. os: [windows-2019, macos-10.15]
  22. # create steps
  23. steps:
  24. # step1: check out repository
  25. - name: Check out git repository
  26. uses: actions/checkout@v2
  27. # step2: install node env
  28. - name: Install Node.js
  29. uses: actions/setup-node@v2-beta
  30. # step3: npm install
  31. - name: npm install
  32. run: |
  33. npm install
  34. # step4: build app for mac/win
  35. - name: build windows app
  36. if: matrix.os == 'windows-2019'
  37. run: |
  38. npm run build-win
  39. env:
  40. GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
  41. - name: build mac app
  42. if: matrix.os == 'macos-10.15'
  43. run: |
  44. npm run build-mac
  45. env:
  46. GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
  47. # step5: cleanup artifacts in build
  48. - name: cleanup artifacts for windows
  49. if: matrix.os == 'windows-2019'
  50. run: |
  51. npx rimraf "build/!(*.exe)"
  52. - name: cleanup artifacts for macosZ
  53. if: matrix.os == 'macos-10.15'
  54. run: |
  55. npx rimraf "build/!(*.dmg)"
  56. # step6: upload artifacts
  57. - name: upload artifacts
  58. uses: actions/upload-artifact@v2
  59. with:
  60. name: ${{ matrix.os }}
  61. path: build
  62. # step7: create release
  63. - name: release
  64. uses: softprops/action-gh-release@v1
  65. if: startsWith(github.ref, 'refs/tags/')
  66. with:
  67. files: "build/**"
  68. env:
  69. GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小桥流水78/article/detail/795119
推荐阅读
相关标签
  

闽ICP备14008679号