publish_and_install_branches.yml 2.8 KB

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