|
| 1 | +name: Release CLI Plugins (v1 Beta) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [v1-beta] |
| 6 | + |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v4 |
| 12 | + - uses: pnpm/action-setup@v4 |
| 13 | + with: |
| 14 | + version: 7 |
| 15 | + - uses: actions/setup-node@v4 |
| 16 | + with: |
| 17 | + node-version: '22.x' |
| 18 | + |
| 19 | + - name: Enable Corepack |
| 20 | + run: corepack enable |
| 21 | + |
| 22 | + - name: Install pnpm |
| 23 | + run: corepack prepare pnpm@7 --activate |
| 24 | + |
| 25 | + - name: Install root dependencies |
| 26 | + run: pnpm install |
| 27 | + |
| 28 | + - name: Reading Configuration |
| 29 | + id: release_config |
| 30 | + uses: rgarcia-phi/json-to-variables@v1.1.0 |
| 31 | + with: |
| 32 | + filename: .github/config/release.json |
| 33 | + prefix: release |
| 34 | + |
| 35 | + # Dev Dependencies |
| 36 | + - name: Installing dependencies of dev dependencies |
| 37 | + id: dev-dependencies-installation |
| 38 | + if: ${{env.release_releaseAll == 'true' || env.release_plugins_dev-dependencies == 'true'}} |
| 39 | + working-directory: ./packages/contentstack-dev-dependencies |
| 40 | + run: npm install |
| 41 | + - name: Compiling dev dependencies |
| 42 | + if: ${{ steps.dev-dependencies-installation.conclusion == 'success' }} |
| 43 | + working-directory: ./packages/contentstack-dev-dependencies |
| 44 | + run: npm run prepack |
| 45 | + - name: Publishing dev dependencies (Beta) |
| 46 | + uses: JS-DevTools/npm-publish@v3 |
| 47 | + if: ${{ steps.dev-dependencies-installation.conclusion == 'success' }} |
| 48 | + with: |
| 49 | + token: ${{ secrets.NPM_TOKEN }} |
| 50 | + package: ./packages/contentstack-dev-dependencies/package.json |
| 51 | + tag: beta |
| 52 | + |
| 53 | + # Utilities |
| 54 | + - name: Installing dependencies of utilities |
| 55 | + id: utilities-installation |
| 56 | + if: ${{env.release_releaseAll == 'true' || env.release_plugins_utilities == 'true'}} |
| 57 | + working-directory: ./packages/contentstack-utilities |
| 58 | + run: npm install |
| 59 | + - name: Compiling utilities |
| 60 | + if: ${{ steps.utilities-installation.conclusion == 'success' }} |
| 61 | + working-directory: ./packages/contentstack-utilities |
| 62 | + run: npm run prepack |
| 63 | + - name: Publishing utilities (Beta) |
| 64 | + uses: JS-DevTools/npm-publish@v3 |
| 65 | + if: ${{ steps.utilities-installation.conclusion == 'success' }} |
| 66 | + with: |
| 67 | + token: ${{ secrets.NPM_TOKEN }} |
| 68 | + package: ./packages/contentstack-utilities/package.json |
| 69 | + tag: beta |
| 70 | + |
| 71 | + # Command |
| 72 | + - name: Installing dependencies of command |
| 73 | + id: command-installation |
| 74 | + if: ${{env.release_releaseAll == 'true' || env.release_plugins_command == 'true'}} |
| 75 | + working-directory: ./packages/contentstack-command |
| 76 | + run: npm install |
| 77 | + - name: Compiling command |
| 78 | + if: ${{ steps.command-installation.conclusion == 'success' }} |
| 79 | + working-directory: ./packages/contentstack-command |
| 80 | + run: npm run prepack |
| 81 | + - name: Publishing command (Beta) |
| 82 | + uses: JS-DevTools/npm-publish@v3 |
| 83 | + if: ${{ steps.command-installation.conclusion == 'success' }} |
| 84 | + with: |
| 85 | + token: ${{ secrets.NPM_TOKEN }} |
| 86 | + package: ./packages/contentstack-command/package.json |
| 87 | + tag: beta |
| 88 | + |
| 89 | + # Config |
| 90 | + - name: Installing dependencies of config |
| 91 | + id: config-installation |
| 92 | + if: ${{env.release_releaseAll == 'true' || env.release_plugins_config == 'true'}} |
| 93 | + working-directory: ./packages/contentstack-config |
| 94 | + run: npm install |
| 95 | + - name: Compiling config |
| 96 | + if: ${{ steps.config-installation.conclusion == 'success' }} |
| 97 | + working-directory: ./packages/contentstack-config |
| 98 | + run: npm run prepack |
| 99 | + - name: Publishing config (Beta) |
| 100 | + uses: JS-DevTools/npm-publish@v3 |
| 101 | + if: ${{ steps.config-installation.conclusion == 'success' }} |
| 102 | + with: |
| 103 | + token: ${{ secrets.NPM_TOKEN }} |
| 104 | + package: ./packages/contentstack-config/package.json |
| 105 | + tag: beta |
| 106 | + |
| 107 | + # Auth |
| 108 | + - name: Installing dependencies of auth |
| 109 | + id: auth-installation |
| 110 | + if: ${{env.release_releaseAll == 'true' || env.release_plugins_auth == 'true'}} |
| 111 | + working-directory: ./packages/contentstack-auth |
| 112 | + run: npm install |
| 113 | + - name: Compiling auth |
| 114 | + if: ${{ steps.auth-installation.conclusion == 'success' }} |
| 115 | + working-directory: ./packages/contentstack-auth |
| 116 | + run: npm run prepack |
| 117 | + - name: Publishing auth (Beta) |
| 118 | + uses: JS-DevTools/npm-publish@v3 |
| 119 | + if: ${{ steps.auth-installation.conclusion == 'success' }} |
| 120 | + with: |
| 121 | + token: ${{ secrets.NPM_TOKEN }} |
| 122 | + package: ./packages/contentstack-auth/package.json |
| 123 | + tag: beta |
| 124 | + |
| 125 | + - name: Create Platform Plugins Beta Release |
| 126 | + # Adjust the ID below to match your actual publishing step ID for plugins |
| 127 | + if: ${{ steps.publish-plugins.conclusion == 'success' }} |
| 128 | + id: create_release_plugins |
| 129 | + env: |
| 130 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 131 | + # Extract version from the output of your plugin publish step |
| 132 | + VERSION: ${{ steps.publish-plugins.outputs.version }} |
| 133 | + run: | |
| 134 | + # Look for the last release specifically starting with 'plugins@v' |
| 135 | + PREVIOUS_BETA=$(gh release list --limit 50 | grep 'platform-plugins@v' | grep 'beta' | head -1 | cut -f1) |
| 136 | +
|
| 137 | + if [ -n "$PREVIOUS_BETA" ]; then |
| 138 | + gh release create "platform-plugins@v$VERSION" --title "Platform Plugins Beta $VERSION" --notes-from-tag "$PREVIOUS_BETA" --prerelease |
| 139 | + else |
| 140 | + gh release create "platform-plugins@v$VERSION" --title "Platform Plugins Beta $VERSION" --generate-notes --prerelease |
| 141 | + fi |
0 commit comments