release-subpackages.yml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. name: Release Subpackages
  2. on:
  3. push:
  4. branches:
  5. - master
  6. paths:
  7. - .github/workflows/release-subpackages.yml
  8. workflow_run:
  9. workflows: ["Node CI for app development"]
  10. types:
  11. - completed
  12. branches:
  13. - master
  14. concurrency:
  15. group: ${{ github.workflow }}-${{ github.ref }}
  16. cancel-in-progress: true
  17. jobs:
  18. release-subpackages-snapshot:
  19. runs-on: ubuntu-latest
  20. steps:
  21. - uses: actions/checkout@v4
  22. - uses: actions/setup-node@v4
  23. with:
  24. node-version: '20'
  25. registry-url: 'https://registry.npmjs.org'
  26. cache: 'yarn'
  27. cache-dependency-path: '**/yarn.lock'
  28. - name: Cache/Restore node_modules
  29. id: cache-dependencies
  30. uses: actions/cache@v4
  31. with:
  32. path: |
  33. **/node_modules
  34. key: node_modules-release-subpackages-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}
  35. restore-keys: |
  36. node_modules-release-subpackages-${{ runner.OS }}-node${{ inputs.node-version }}-
  37. - name: Install dependencies
  38. run: |
  39. yarn global add turbo
  40. yarn global add node-gyp
  41. yarn --frozen-lockfile
  42. - name: Snapshot release to npm
  43. run: |
  44. yarn release-subpackages:next
  45. env:
  46. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  47. NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
  48. release-subpackages:
  49. runs-on: ubuntu-latest
  50. steps:
  51. - uses: actions/checkout@v4
  52. - uses: actions/setup-node@v4
  53. with:
  54. node-version: '20'
  55. cache: 'yarn'
  56. cache-dependency-path: '**/yarn.lock'
  57. - name: Cache/Restore node_modules
  58. id: cache-dependencies
  59. uses: actions/cache@v4
  60. with:
  61. path: |
  62. **/node_modules
  63. key: node_modules-release-subpackages-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}
  64. restore-keys: |
  65. node_modules-release-subpackages-${{ runner.OS }}-node${{ inputs.node-version }}-
  66. - name: Install dependencies
  67. run: |
  68. yarn global add turbo
  69. yarn global add node-gyp
  70. yarn --frozen-lockfile
  71. - name: Create Release Pull Request or Publish to npm
  72. id: changesets
  73. uses: changesets/action@v1
  74. with:
  75. publish: yarn release-subpackages
  76. env:
  77. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  78. NPM_TOKEN: ${{ secrets.NPM_TOKEN }}