publish_and_install.yml 3.2 KB

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