publish_and_install.yml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. name: Publish & Install
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - major
  7. - minor
  8. - parallel-e2e
  9. pull_request:
  10. branches:
  11. - master
  12. - major
  13. - minor
  14. defaults:
  15. run:
  16. shell: bash
  17. jobs:
  18. publish_install:
  19. runs-on: ${{ matrix.os }}
  20. strategy:
  21. matrix:
  22. os: [ubuntu-latest, windows-latest, macos-latest]
  23. node-version: [14.x, 16.x]
  24. fail-fast: false
  25. steps:
  26. - uses: actions/checkout@v3
  27. - name: Use Node.js ${{ matrix.node-version }}
  28. uses: actions/setup-node@v3
  29. with:
  30. node-version: ${{ matrix.node-version }}
  31. - name: Install Verdaccio
  32. run: |
  33. npm install -g verdaccio
  34. npm install -g verdaccio-auth-memory
  35. npm install -g verdaccio-memory
  36. npm install -g npm-auth-to-token@1.0.0
  37. tmp_registry_log=`mktemp`
  38. mkdir -p $HOME/.config/verdaccio
  39. cp -v ./.github/workflows/verdaccio/config.yaml $HOME/.config/verdaccio/config.yaml
  40. nohup verdaccio --config $HOME/.config/verdaccio/config.yaml &>$tmp_registry_log &
  41. npm-auth-to-token -u test -p test -e test@test.com -r http://0.0.0.0:4873
  42. - name: Windows dependencies
  43. if: matrix.os == 'windows-latest'
  44. run: npm install -g @angular/cli
  45. - name: Get yarn cache directory path
  46. id: yarn-cache-dir-path
  47. run: echo "::set-output name=dir::$(yarn cache dir)"
  48. - uses: actions/cache@v3
  49. id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
  50. with:
  51. path: '**/node_modules'
  52. key: ${{ runner.os }}-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
  53. restore-keys: |
  54. ${{ runner.os }}-${{ matrix.node-version }}-yarn-
  55. - name: Yarn install
  56. if: steps.yarn-cache.outputs.cache-hit != 'true'
  57. run: |
  58. yarn config set unsafe-perm true
  59. yarn install --network-timeout 1000000 --prefer-offline
  60. env:
  61. CI: true
  62. - name: Bootstrap
  63. run: yarn bootstrap
  64. env:
  65. CI: true
  66. - name: Publish to Verdaccio
  67. run: |
  68. yarn lerna publish prepatch --preid ci --no-push --no-git-tag-version --no-commit-hooks --force-publish "*" --yes --dist-tag ci --registry http://0.0.0.0:4873
  69. - name: Install via @vendure/create
  70. run: |
  71. mkdir -p $HOME/install
  72. cd $HOME/install
  73. npm set registry=http://0.0.0.0:4873
  74. npm dist-tag ls @vendure/create
  75. npx @vendure/create@ci test-app --ci --use-npm --log-level info
  76. - name: Server smoke tests
  77. run: |
  78. cd $HOME/install/test-app
  79. npm run dev &
  80. node $GITHUB_WORKSPACE/.github/workflows/scripts/smoke-tests