build.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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
  45. sudo apt-get install --no-install-recommends -y wine mono gcc-multilib g++-multilib || true
  46. - uses: actions/checkout@v2
  47. - name: Setup Node.js environment
  48. uses: actions/setup-node@v1.4.3
  49. with:
  50. node-version: 10.x
  51. - name: Install dependencies
  52. run: |
  53. npm i
  54. - name: Build Linux app (32 bit)
  55. run: npm run build:linux32
  56. - name: Build Linux app (64 bit)
  57. run: npm run build:linux64
  58. - name: Build Windows App (32 bit)
  59. run: npm run build:win32
  60. - name: Build Windows App (64 bit)
  61. run: npm run build:win64
  62. - name: Upload - push to artifact files
  63. uses: actions/upload-artifact@v1
  64. with:
  65. name: AhMyth
  66. path: /dist/