publish_and_install.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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, 22.x]
  24. fail-fast: false
  25. steps:
  26. - uses: actions/checkout@v4
  27. - name: Use Node.js ${{ matrix.node-version }}
  28. uses: actions/setup-node@v4
  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: npm install
  50. run: |
  51. npm install
  52. env:
  53. CI: true
  54. - name: Publish to Verdaccio
  55. run: |
  56. nohup verdaccio --config $HOME/.config/verdaccio/config.yaml &
  57. wait-on http://localhost:4873
  58. npx lerna publish prepatch --preid ci --no-push --no-git-tag-version --no-commit-hooks --force-publish "*" --yes --dist-tag ci --registry http://localhost:4873
  59. - name: Install via @vendure/create
  60. run: |
  61. mkdir -p $HOME/install
  62. cd $HOME/install
  63. nohup verdaccio --config $HOME/.config/verdaccio/config.yaml &
  64. wait-on http://localhost:4873
  65. npm set registry=http://localhost:4873
  66. npm dist-tag ls @vendure/create
  67. npx @vendure/create@ci test-app --ci --use-npm --log-level info
  68. - name: Server smoke tests
  69. run: |
  70. cd $HOME/install/test-app
  71. npm run dev &
  72. node $GITHUB_WORKSPACE/.github/workflows/scripts/smoke-tests