Merge pull request #2234 from contentstack/v2-beta-dev #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release CLI Plugins (Beta) | |
| on: | |
| push: | |
| branches: [v2-beta] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 7 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.x' | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Install pnpm | |
| run: corepack prepare pnpm@7 --activate | |
| - name: Install root dependencies | |
| run: pnpm install | |
| - name: Reading Configuration | |
| id: release_config | |
| uses: rgarcia-phi/json-to-variables@v1.1.0 | |
| with: | |
| filename: .github/config/release.json | |
| prefix: release | |
| # Dev Dependencies | |
| - name: Installing dependencies of dev dependencies | |
| id: dev-dependencies-installation | |
| if: ${{env.release_releaseAll == 'true' || env.release_plugins_dev-dependencies == 'true'}} | |
| working-directory: ./packages/contentstack-dev-dependencies | |
| run: npm install | |
| - name: Compiling dev dependencies | |
| if: ${{ steps.dev-dependencies-installation.conclusion == 'success' }} | |
| working-directory: ./packages/contentstack-dev-dependencies | |
| run: npm run prepack | |
| - name: Publishing dev dependencies (Beta) | |
| uses: JS-DevTools/npm-publish@v3 | |
| if: ${{ steps.dev-dependencies-installation.conclusion == 'success' }} | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| package: ./packages/contentstack-dev-dependencies/package.json | |
| tag: beta | |
| # Utilities | |
| - name: Installing dependencies of utilities | |
| id: utilities-installation | |
| if: ${{env.release_releaseAll == 'true' || env.release_plugins_utilities == 'true'}} | |
| working-directory: ./packages/contentstack-utilities | |
| run: npm install | |
| - name: Compiling utilities | |
| if: ${{ steps.utilities-installation.conclusion == 'success' }} | |
| working-directory: ./packages/contentstack-utilities | |
| run: npm run prepack | |
| - name: Publishing utilities (Beta) | |
| uses: JS-DevTools/npm-publish@v3 | |
| if: ${{ steps.utilities-installation.conclusion == 'success' }} | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| package: ./packages/contentstack-utilities/package.json | |
| tag: beta | |
| # Variants | |
| - name: Installing dependencies of variants | |
| id: variants-installation | |
| if: ${{env.release_releaseAll == 'true' || env.release_plugins_utilities == 'true'}} | |
| working-directory: ./packages/contentstack-variants | |
| run: npm install | |
| - name: Compiling variants | |
| if: ${{ steps.variants-installation.conclusion == 'success' }} | |
| working-directory: ./packages/contentstack-variants | |
| run: npm run prepack | |
| - name: Publishing variants (Beta) | |
| uses: JS-DevTools/npm-publish@v3 | |
| if: ${{ steps.variants-installation.conclusion == 'success' }} | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| package: ./packages/contentstack-variants/package.json | |
| access: public | |
| tag: beta | |
| # Command | |
| - name: Installing dependencies of command | |
| id: command-installation | |
| if: ${{env.release_releaseAll == 'true' || env.release_plugins_command == 'true'}} | |
| working-directory: ./packages/contentstack-command | |
| run: npm install | |
| - name: Compiling command | |
| if: ${{ steps.command-installation.conclusion == 'success' }} | |
| working-directory: ./packages/contentstack-command | |
| run: npm run prepack | |
| - name: Publishing command (Beta) | |
| uses: JS-DevTools/npm-publish@v3 | |
| if: ${{ steps.command-installation.conclusion == 'success' }} | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| package: ./packages/contentstack-command/package.json | |
| tag: beta | |
| # Config | |
| - name: Installing dependencies of config | |
| id: config-installation | |
| if: ${{env.release_releaseAll == 'true' || env.release_plugins_config == 'true'}} | |
| working-directory: ./packages/contentstack-config | |
| run: npm install | |
| - name: Compiling config | |
| if: ${{ steps.config-installation.conclusion == 'success' }} | |
| working-directory: ./packages/contentstack-config | |
| run: npm run prepack | |
| - name: Publishing config (Beta) | |
| uses: JS-DevTools/npm-publish@v3 | |
| if: ${{ steps.config-installation.conclusion == 'success' }} | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| package: ./packages/contentstack-config/package.json | |
| tag: beta | |
| # Auth | |
| - name: Installing dependencies of auth | |
| id: auth-installation | |
| if: ${{env.release_releaseAll == 'true' || env.release_plugins_auth == 'true'}} | |
| working-directory: ./packages/contentstack-auth | |
| run: npm install | |
| - name: Compiling auth | |
| if: ${{ steps.auth-installation.conclusion == 'success' }} | |
| working-directory: ./packages/contentstack-auth | |
| run: npm run prepack | |
| - name: Publishing auth (Beta) | |
| uses: JS-DevTools/npm-publish@v3 | |
| if: ${{ steps.auth-installation.conclusion == 'success' }} | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| package: ./packages/contentstack-auth/package.json | |
| tag: beta | |
| # Export | |
| - name: Installing dependencies of export | |
| id: export-installation | |
| if: ${{ env.release_releaseAll == 'true' || env.release_plugins_export == 'true'}} | |
| working-directory: ./packages/contentstack-export | |
| run: npm install | |
| - name: Compiling export | |
| if: ${{ steps.export-installation.conclusion == 'success' }} | |
| working-directory: ./packages/contentstack-export | |
| run: npm run prepack | |
| - name: Publishing export (Beta) | |
| uses: JS-DevTools/npm-publish@v3 | |
| if: ${{ steps.export-installation.conclusion == 'success' }} | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| package: ./packages/contentstack-export/package.json | |
| tag: beta | |
| # Audit | |
| - name: Installing dependencies of audit | |
| id: audit-installation | |
| if: ${{env.release_releaseAll == 'true' || env.release_plugins_audit == 'true'}} | |
| working-directory: ./packages/contentstack-audit | |
| run: npm install | |
| - name: Compiling audit | |
| if: ${{ steps.audit-installation.conclusion == 'success' }} | |
| working-directory: ./packages/contentstack-audit | |
| run: npm run prepack | |
| - name: Publishing audit (Beta) | |
| uses: JS-DevTools/npm-publish@v3 | |
| if: ${{ steps.audit-installation.conclusion == 'success' }} | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| package: ./packages/contentstack-audit/package.json | |
| access: public | |
| tag: beta | |
| # Import | |
| - name: Installing dependencies of import | |
| id: import-installation | |
| if: ${{env.release_releaseAll == 'true' || env.release_plugins_import == 'true'}} | |
| working-directory: ./packages/contentstack-import | |
| run: npm install | |
| - name: Compiling import | |
| if: ${{ steps.import-installation.conclusion == 'success' }} | |
| working-directory: ./packages/contentstack-import | |
| run: npm run prepack | |
| - name: Publishing import (Beta) | |
| uses: JS-DevTools/npm-publish@v3 | |
| if: ${{ steps.import-installation.conclusion == 'success' }} | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| package: ./packages/contentstack-import/package.json | |
| tag: beta | |
| # Clone | |
| - name: Installing dependencies of clone | |
| id: clone-installation | |
| if: ${{env.release_releaseAll == 'true' || env.release_plugins_clone == 'true'}} | |
| working-directory: ./packages/contentstack-clone | |
| run: npm install | |
| - name: Publishing clone (Beta) | |
| uses: JS-DevTools/npm-publish@v3 | |
| if: ${{ steps.clone-installation.conclusion == 'success' }} | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| package: ./packages/contentstack-clone/package.json | |
| tag: beta | |
| # Import Setup | |
| - name: Installing dependencies of import-setup | |
| id: import-setup-installation | |
| if: ${{env.release_releaseAll == 'true' || env.release_plugins_import_setup == 'true'}} | |
| working-directory: ./packages/contentstack-import-setup | |
| run: npm install | |
| - name: Compiling import-setup | |
| if: ${{ steps.import-setup-installation.conclusion == 'success' }} | |
| working-directory: ./packages/contentstack-import-setup | |
| run: npm run prepack | |
| - name: Publishing import-setup (Beta) | |
| uses: JS-DevTools/npm-publish@v3 | |
| if: ${{ steps.import-setup-installation.conclusion == 'success' }} | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| package: ./packages/contentstack-import-setup/package.json | |
| access: public | |
| tag: beta | |
| # Export to CSV | |
| - name: Installing dependencies of export to csv | |
| id: export-to-csv-installation | |
| if: ${{env.release_releaseAll == 'true' || env.release_plugins_export-to-csv == 'true'}} | |
| working-directory: ./packages/contentstack-export-to-csv | |
| run: npm install | |
| - name: Publishing export to csv (Beta) | |
| uses: JS-DevTools/npm-publish@v3 | |
| if: ${{ steps.export-to-csv-installation.conclusion == 'success' }} | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| package: ./packages/contentstack-export-to-csv/package.json | |
| tag: beta | |
| # Migrate RTE | |
| - name: Installing dependencies of migrate rte | |
| id: migrate-rte-installation | |
| if: ${{env.release_releaseAll == 'true' || env.release_plugins_migrate-rte == 'true'}} | |
| working-directory: ./packages/contentstack-migrate-rte | |
| run: npm install | |
| - name: Publishing migrate rte (Beta) | |
| uses: JS-DevTools/npm-publish@v3 | |
| if: ${{ steps.migrate-rte-installation.conclusion == 'success' }} | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| package: ./packages/contentstack-migrate-rte/package.json | |
| tag: beta | |
| # Migration | |
| - name: Installing dependencies of migration | |
| id: migration-installation | |
| if: ${{env.release_releaseAll == 'true' || env.release_plugins_migration == 'true'}} | |
| working-directory: ./packages/contentstack-migration | |
| run: npm install | |
| - name: Publishing migration (Beta) | |
| uses: JS-DevTools/npm-publish@v3 | |
| if: ${{ steps.migration-installation.conclusion == 'success' }} | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| package: ./packages/contentstack-migration/package.json | |
| tag: beta | |
| # Seed | |
| - name: Installing dependencies of seed | |
| id: seed-installation | |
| if: ${{env.release_releaseAll == 'true' || env.release_plugins_seed == 'true'}} | |
| working-directory: ./packages/contentstack-seed | |
| run: npm install | |
| - name: Compiling seed | |
| if: ${{ steps.seed-installation.conclusion == 'success' }} | |
| working-directory: ./packages/contentstack-seed | |
| run: npm run prepack | |
| - name: Publishing seed (Beta) | |
| uses: JS-DevTools/npm-publish@v3 | |
| if: ${{ steps.seed-installation.conclusion == 'success' }} | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| package: ./packages/contentstack-seed/package.json | |
| tag: beta | |
| # Bootstrap | |
| - name: Installing dependencies of bootstrap | |
| id: bootstrap-installation | |
| if: ${{env.release_releaseAll == 'true' || env.release_plugins_bootstrap == 'true'}} | |
| working-directory: ./packages/contentstack-bootstrap | |
| run: npm install | |
| - name: Compiling bootstrap | |
| if: ${{ steps.bootstrap-installation.conclusion == 'success' }} | |
| working-directory: ./packages/contentstack-bootstrap | |
| run: npm run prepack | |
| - name: Publishing bootstrap (Beta) | |
| uses: JS-DevTools/npm-publish@v3 | |
| if: ${{ steps.bootstrap-installation.conclusion == 'success' }} | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| package: ./packages/contentstack-bootstrap/package.json | |
| tag: beta | |
| # Bulk Publish | |
| - name: Installing dependencies of bulk publish | |
| id: bulk-publish-installation | |
| if: ${{env.release_releaseAll == 'true' || env.release_plugins_bulk-publish == 'true'}} | |
| working-directory: ./packages/contentstack-bulk-publish | |
| run: npm install | |
| - name: Publishing bulk publish (Beta) | |
| uses: JS-DevTools/npm-publish@v3 | |
| if: ${{ steps.bulk-publish-installation.conclusion == 'success' }} | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| package: ./packages/contentstack-bulk-publish/package.json | |
| tag: beta | |
| # Branches | |
| - name: Installing dependencies of branches | |
| id: branches-installation | |
| if: ${{env.release_releaseAll == 'true' || env.release_plugins_branches == 'true'}} | |
| working-directory: ./packages/contentstack-branches | |
| run: npm install | |
| - name: Compiling branches | |
| if: ${{ steps.branches-installation.conclusion == 'success' }} | |
| working-directory: ./packages/contentstack-branches | |
| run: npm run prepack | |
| - name: Publishing branches (Beta) | |
| uses: JS-DevTools/npm-publish@v3 | |
| if: ${{ steps.branches-installation.conclusion == 'success' }} | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| package: ./packages/contentstack-branches/package.json | |
| access: public | |
| tag: beta | |
| # Core CLI | |
| - name: Installing dependencies of core | |
| id: core-installation | |
| if: ${{env.release_releaseAll == 'true' || env.release_plugins_core == 'true'}} | |
| working-directory: ./packages/contentstack | |
| run: npm install | |
| - name: Compiling core | |
| if: ${{ steps.core-installation.conclusion == 'success' }} | |
| working-directory: ./packages/contentstack | |
| run: npm run prepack | |
| - name: Publishing core (Beta) | |
| id: publish-core | |
| uses: JS-DevTools/npm-publish@v3 | |
| if: ${{ steps.core-installation.conclusion == 'success' }} | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| package: ./packages/contentstack/package.json | |
| tag: beta | |
| - name: Create Beta Release | |
| if: ${{ steps.publish-core.conclusion == 'success' }} | |
| id: create_release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| VERSION: ${{ steps.publish-core.outputs.version }} | |
| run: | | |
| # Get the previous beta release for comparison | |
| PREVIOUS_BETA=$(gh release list --limit 10 | grep 'beta' | head -1 | cut -f1) | |
| if [ -n "$PREVIOUS_BETA" ]; then | |
| gh release create v"$VERSION" --title "Beta Release $VERSION" --notes-from-tag "$PREVIOUS_BETA" --prerelease | |
| else | |
| gh release create v"$VERSION" --title "Beta Release $VERSION" --generate-notes --prerelease | |
| fi |