publish_and_install_master.yml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. name: Publish & Install
  2. on:
  3. push:
  4. branches:
  5. - master
  6. paths:
  7. - 'packages/**'
  8. - 'package.json'
  9. - 'package-lock.json'
  10. defaults:
  11. run:
  12. shell: bash
  13. concurrency:
  14. group: ${{ github.workflow }}-${{ github.ref }}
  15. cancel-in-progress: true
  16. jobs:
  17. publish_install:
  18. runs-on: ${{ matrix.os }}
  19. strategy:
  20. matrix:
  21. os: [ubuntu-latest, windows-latest, macos-latest]
  22. node-version: [20.x, 22.x]
  23. fail-fast: false
  24. steps:
  25. - uses: actions/checkout@v4
  26. - name: Use Node.js ${{ matrix.node-version }}
  27. uses: actions/setup-node@v4
  28. with:
  29. node-version: ${{ matrix.node-version }}
  30. - name: Install Verdaccio
  31. run: |
  32. npm install -g verdaccio
  33. npm install -g wait-on
  34. tmp_registry_log=`mktemp`
  35. mkdir -p $HOME/.config/verdaccio
  36. cp -v ./.github/workflows/verdaccio/config.yaml $HOME/.config/verdaccio/config.yaml
  37. nohup verdaccio --config $HOME/.config/verdaccio/config.yaml &
  38. wait-on http://localhost:4873
  39. TOKEN_RES=$(curl -XPUT \
  40. -H "Content-type: application/json" \
  41. -d '{ "name": "test", "password": "test" }' \
  42. 'http://localhost:4873/-/user/org.couchdb.user:test')
  43. TOKEN=$(echo "$TOKEN_RES" | jq -r '.token')
  44. npm set //localhost:4873/:_authToken $TOKEN
  45. - name: Windows dependencies
  46. if: matrix.os == 'windows-latest'
  47. run: npm install -g @angular/cli
  48. - name: npm install
  49. run: |
  50. npm install
  51. env:
  52. CI: true
  53. - name: Publish to Verdaccio
  54. run: |
  55. nohup verdaccio --config $HOME/.config/verdaccio/config.yaml &
  56. wait-on http://localhost:4873
  57. 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
  58. - name: Install via @vendure/create
  59. run: |
  60. mkdir -p $HOME/install
  61. cd $HOME/install
  62. nohup verdaccio --config $HOME/.config/verdaccio/config.yaml &
  63. wait-on http://localhost:4873
  64. npm set registry=http://localhost:4873
  65. npm dist-tag ls @vendure/create
  66. npx @vendure/create@ci test-app --ci --use-npm --log-level info
  67. - name: Server smoke tests
  68. run: |
  69. cd $HOME/install/test-app
  70. npm run dev &
  71. node $GITHUB_WORKSPACE/.github/workflows/scripts/smoke-tests