2. Bump versions - CLI 7.3.0-dev.5 from dev #6091
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: 2. Bump versions | |
| run-name: 2. Bump versions - CLI ${{ inputs.version }} from ${{ inputs.npm_channel }} | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| npm_channel: | |
| description: 'Prisma CLI NPM Channel to bump' | |
| required: true | |
| type: choice | |
| options: | |
| - latest | |
| - dev | |
| - patch-dev | |
| version: | |
| description: 'New Prisma CLI version in that channel' | |
| required: true | |
| concurrency: | |
| group: version-management | |
| cancel-in-progress: false | |
| env: | |
| ENVIRONMENT: ${{ secrets.ENVIRONMENT }} | |
| PRISMA_TELEMETRY_INFORMATION: 'language-tools 2_bump_versions.yml' | |
| RELEASE_CHANNEL: ${{ github.event.inputs.npm_channel == 'latest' && 'stable' || 'insider' }} | |
| jobs: | |
| bump: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 7 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.PRISMA_BOT_TOKEN }} | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Install Dependencies | |
| run: pnpm install | |
| - name: Setup Git | |
| run: | | |
| sh scripts/set_git_credentials.sh | |
| - name: Print inputs | |
| run: | | |
| echo ${{github.event.inputs.npm_channel}} | |
| echo ${{github.event.inputs.version}} | |
| - name: Update versions file in scripts folder | |
| run: | | |
| echo "${{ github.event.inputs.version }}" >scripts/versions/prisma_${{ github.event.inputs.npm_channel }} | |
| if git diff --exit-code; then | |
| echo "Version has not changed! We should not attempt to bump." | |
| exit 1 | |
| fi | |
| - name: Update next extension version in scripts folder and output for later use | |
| id: update # Used to access the calculated next extension version in later steps | |
| run: node scripts/bump_extension_version.mjs prisma-${{ github.event.inputs.npm_channel }}-release | |
| - name: Commit and Push | |
| run: | | |
| sh scripts/commit_and_push.sh "[skip ci] bump Prisma CLI ${{ github.event.inputs.npm_channel }} version to ${{ github.event.inputs.version }} and extension version to ${{ steps.update.outputs.next_extension_version }} in scripts." | |
| - name: Switch branch | |
| id: setup_branch | |
| run: | | |
| sh scripts/setup_branch.sh ${{ github.event.inputs.npm_channel }} | |
| - name: Check for minor or major release | |
| id: is_minor_or_major | |
| run: | | |
| VERSION_SCRIPT=$([ -f scripts/is_minor_or_major_release.mjs ] && echo "is_minor_or_major_release.mjs" || echo "is_minor_or_major_release.js") | |
| node "scripts/$VERSION_SCRIPT" ${{ github.event.inputs.npm_channel }} | |
| - name: Reset on 'main' branch if minor or major release | |
| if: ${{steps.is_minor_or_major.outputs.is_minor_or_major_release}} | |
| run: | | |
| git reset --hard main | |
| git push --force origin stable | |
| - name: Update Prisma CLI version and VS Code extension version | |
| run: | | |
| node scripts/update_package_json_files.mjs ${{ github.event.inputs.npm_channel }} ${{ steps.update.outputs.next_extension_version }} ${{ github.event.inputs.version }} | |
| - name: Install Dependencies to update lock file | |
| run: pnpm install --frozen-lockfile=false | |
| - name: Push to branch | |
| run: | | |
| sh scripts/commit_and_push.sh "[skip ci] bump extension version to ${{ steps.update.outputs.next_extension_version }} in package.json" ${{ steps.setup_branch.outputs.branch}} ${{ steps.setup_branch.outputs.new_branch }} | |
| - name: Trigger next workflow for Language Server tests | |
| uses: benc-uk/workflow-dispatch@v1 | |
| with: | |
| workflow: 3. Test Language Server and publish | |
| token: ${{ secrets.PRISMA_BOT_TOKEN }} | |
| inputs: '{ "release_channel": "${{ env.RELEASE_CHANNEL }}", "extension_version": "${{ steps.update.outputs.next_extension_version }}", "branch": "${{steps.setup_branch.outputs.branch}}", "trigger_reason": "Prisma CLI version ${{github.event.inputs.version}}" }' |