build.yml 2.2 KB

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