publish_and_install.yml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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: [18.x, 20.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 wait-on
  35. tmp_registry_log=`mktemp`
  36. mkdir -p $HOME/.config/verdaccio
  37. cp -v ./.github/workflows/verdaccio/config.yaml $HOME/.config/verdaccio/config.yaml
  38. nohup verdaccio --config $HOME/.config/verdaccio/config.yaml &
  39. wait-on http://localhost:4873
  40. TOKEN_RES=$(curl -XPUT \
  41. -H "Content-type: application/json" \
  42. -d '{ "name": "test", "password": "test" }' \
  43. 'http://localhost:4873/-/user/org.couchdb.user:test')
  44. TOKEN=$(echo "$TOKEN_RES" | jq -r '.token')
  45. npm set //localhost:4873/:_authToken $TOKEN
  46. - name: Windows dependencies
  47. if: matrix.os == 'windows-latest'
  48. run: npm install -g @angular/cli
  49. - name: Yarn install
  50. run: |
  51. npm i -g yarn
  52. yarn config set unsafe-perm true
  53. yarn install --network-timeout 1000000 --prefer-offline
  54. env:
  55. CI: true
  56. - name: Publish to Verdaccio
  57. run: |
  58. nohup verdaccio --config $HOME/.config/verdaccio/config.yaml &
  59. wait-on http://localhost:4873
  60. yarn lerna publish prepatch --preid ci --no-push --no-git-tag-version --no-commit-hooks --force-publish "*" --yes --dist-tag ci --registry http://localhost:4873
  61. - name: Install via @vendure/create
  62. run: |
  63. mkdir -p $HOME/install
  64. cd $HOME/install
  65. nohup verdaccio --config $HOME/.config/verdaccio/config.yaml &
  66. wait-on http://localhost:4873
  67. npm set registry=http://localhost:4873
  68. npm dist-tag ls @vendure/create
  69. npx @vendure/create@ci test-app --ci --use-npm --log-level info
  70. - name: Server smoke tests
  71. run: |
  72. cd $HOME/install/test-app
  73. npm run dev &
  74. node $GITHUB_WORKSPACE/.github/workflows/scripts/smoke-tests