release-subpackages.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. name: Release Subpackages
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - dev/*.*.*
  7. concurrency: ${{ github.workflow }}-${{ github.ref }}
  8. jobs:
  9. release-subpackages:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - uses: actions/checkout@v4
  13. - uses: actions/setup-node@v4
  14. with:
  15. node-version: '20'
  16. cache: 'yarn'
  17. cache-dependency-path: '**/yarn.lock'
  18. - name: Cache/Restore node_modules
  19. id: cache-dependencies
  20. uses: actions/cache@v4
  21. with:
  22. path: |
  23. **/node_modules
  24. key: node_modules-release-subpackages-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}
  25. restore-keys: |
  26. node_modules-release-subpackages-${{ runner.OS }}-node${{ inputs.node-version }}-
  27. - name: Install dependencies
  28. run: |
  29. yarn global add turbo
  30. yarn global add node-gyp
  31. yarn --frozen-lockfile
  32. - name: Create Release Pull Request or Publish to npm
  33. id: changesets
  34. uses: changesets/action@v1
  35. with:
  36. # This expects you to have a script called release which does a build for your packages and calls changeset publish
  37. publish: yarn release-subpackages
  38. env:
  39. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  40. NPM_TOKEN: ${{ secrets.NPM_TOKEN }}