publish_and_install_branches.yml 2.9 KB

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