build.yml 2.1 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. - 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 deps
  43. run: sudo apt-get install --no-install-recommends -y wine mono gcc-multilib g++-multilib || true
  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/