|
| 1 | +name: Release CLI Platform Plugins |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + |
| 6 | +jobs: |
| 7 | + build: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v4 |
| 11 | + - uses: pnpm/action-setup@v4 |
| 12 | + with: |
| 13 | + version: 10.28.0 |
| 14 | + - uses: actions/setup-node@v4 |
| 15 | + with: |
| 16 | + node-version: '22.x' |
| 17 | + |
| 18 | + - name: Enable Corepack |
| 19 | + run: corepack enable |
| 20 | + |
| 21 | + - name: Install pnpm |
| 22 | + run: corepack prepare pnpm@10.28.0 --activate |
| 23 | + |
| 24 | + - name: Clean the repository |
| 25 | + run: pnpm run clean:all |
| 26 | + |
| 27 | + - name: Install root dependencies |
| 28 | + run: pnpm install --no-frozen-lockfile |
| 29 | + |
| 30 | + - name: Build all plugins |
| 31 | + run: pnpm -r --sort run build |
| 32 | + |
| 33 | + - name: Reading Configuration |
| 34 | + id: release_config |
| 35 | + uses: rgarcia-phi/json-to-variables@v1.1.0 |
| 36 | + with: |
| 37 | + filename: .github/config/release.json |
| 38 | + prefix: release |
| 39 | + |
| 40 | + # Utilities |
| 41 | + - name: Publishing utilities (Production) |
| 42 | + uses: JS-DevTools/npm-publish@v3 |
| 43 | + with: |
| 44 | + token: ${{ secrets.NPM_TOKEN }} |
| 45 | + package: ./packages/contentstack-utilities/package.json |
| 46 | + tag: latest |
| 47 | + |
| 48 | + # Command |
| 49 | + - name: Publishing command (Production) |
| 50 | + uses: JS-DevTools/npm-publish@v3 |
| 51 | + with: |
| 52 | + token: ${{ secrets.NPM_TOKEN }} |
| 53 | + package: ./packages/contentstack-command/package.json |
| 54 | + tag: latest |
| 55 | + |
| 56 | + # Config |
| 57 | + - name: Publishing config (Production) |
| 58 | + uses: JS-DevTools/npm-publish@v3 |
| 59 | + with: |
| 60 | + token: ${{ secrets.NPM_TOKEN }} |
| 61 | + package: ./packages/contentstack-config/package.json |
| 62 | + tag: latest |
| 63 | + |
| 64 | + # Auth |
| 65 | + - name: Publishing auth (Production) |
| 66 | + uses: JS-DevTools/npm-publish@v3 |
| 67 | + with: |
| 68 | + token: ${{ secrets.NPM_TOKEN }} |
| 69 | + package: ./packages/contentstack-auth/package.json |
| 70 | + tag: latest |
0 commit comments