build.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # This is a basic workflow to help you get started with Actions
  2. name: CI
  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. branches:
  8. - feature/githubActionsBuild
  9. - master
  10. - development
  11. release:
  12. types: [created]
  13. jobs:
  14. build:
  15. defaults:
  16. run:
  17. working-directory:
  18. AhMyth-Server
  19. runs-on: ubuntu-latest
  20. steps:
  21. - name: Cache node_modules
  22. uses: actions/cache@v2
  23. with:
  24. path: ~/.npm
  25. key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
  26. restore-keys: |
  27. ${{ runner.os }}-node-
  28. - name: Cache Electron
  29. uses: actions/cache@v1
  30. with:
  31. path: ${{ github.workspace }}/.cache/electron
  32. key: ${{ runner.os }}-electron-cache-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
  33. restore-keys: |
  34. ${{ runner.os }}-electron-cache-
  35. - name: Cache Electron-Builder
  36. uses: actions/cache@v1
  37. with:
  38. path: ${{ github.workspace }}/.cache/electron-builder
  39. key: ${{ runner.os }}-electron-builder-cache-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
  40. restore-keys: |
  41. ${{ runner.os }}-electron-builder-cache-
  42. - name: Install apt dependencies (need for Windows build)
  43. run: |
  44. sudo apt-get update && sudo apt-get install --no-install-recommends -y wine mono gcc-multilib g++-multilib
  45. - uses: actions/checkout@v2
  46. - name: Setup Node.js environment
  47. uses: actions/setup-node@v1.4.3
  48. with:
  49. node-version: 10.x
  50. - name: Install dependencies
  51. run: |
  52. npm i
  53. - name: Build Linux app (32 bit)
  54. run: npm run build:linux32
  55. - name: Build Linux app (64 bit)
  56. run: npm run build:linux64
  57. - name: Build Windows App (32 bit)
  58. run: npm run build:win32
  59. - name: Build Windows App (64 bit)
  60. run: npm run build:win64
  61. - name: Upload - push to artifact files
  62. uses: actions/upload-artifact@v1
  63. with:
  64. name: AhMyth
  65. path: /dist/