publish_and_install_master.yml 2.8 KB

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