Skip to content

chore: fix patch release CI #1838

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/1_2_b_bump_extension_only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
with:
node-version: '20'
cache: 'npm'
- name: Install Dependencies
run: npm install && npm run bootstrap
shell: bash
- name: checkout main if necessary
if: endsWith(github.ref, '/main') == false
run: git fetch && git checkout main
- name: Install Dependencies
run: npm install && npm run bootstrap
shell: bash
- name: Setup Git
run: |
sh scripts/set_git_credentials.sh
Expand All @@ -47,7 +47,7 @@ jobs:

- name: Checkout previous branch
if: endsWith(github.ref, '/main') == false
run: git checkout ${{ github.ref_name }}
run: git checkout -f ${{ github.ref_name }}
- name: Update VS Code extension version
run: |
node scripts/update_package_json_files.js dev ${{ steps.update.outputs.next_extension_version }} ""
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/1_2_c_promote_patch_to_stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
with:
node-version: '20'
cache: 'npm'
- name: Install Dependencies
run: npm install && npm run bootstrap
- name: Checkout main
run: git fetch && git checkout main
- name: Install Dependencies
run: npm install && npm run bootstrap
- name: Setup Git
run: |
sh scripts/set_git_credentials.sh
Expand Down
10 changes: 6 additions & 4 deletions packages/vscode/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,11 @@ Note that the personal access token is only valid for a year and will need to be

### Manual Publishing

To do an extension only publish, please follow these steps:
To do an extension only publish which does not coincide with a Prisma ORM release, please follow these steps:

1. Create a patch branch ending with `.x` if it doesn't exist yet.
1. Create a patch branch ending with `.x` (e.g. `6.7.x`) if it doesn't exist yet.
2. Push to the patch branch with the changes.
3. Step 2 will trigger the script `patch-extension-only`, creating an Insider release
4. If you were satisfied, manually trigger GH action workflow `publish-patch-branch-to-stable` to release the patch to the stable extension
3. Step 2 will trigger the workflow [`1/2b. Bump versions for extension only (on push to main and patch branch)`](../../.github/workflows/1_2_b_bump_extension_only.yml). This will kickoff building an Insider release with only those changes - temporarily overwriting any prior Insider releases triggered from the main branch.
4. Once you want to release to stable, manually trigger GH action workflow [`1/2c. Bump versions for extension only (promotes patch branch to stable release)`](../../.github/workflows/1_2_c_promote_patch_to_stable.yml). Choose your patch branch in `Use workflow from` in the GH action UI.

Note: Best cherry-pick the changes you want to include from the main branch onto the patch branch. Do NOT merge the patch branch back into main or stable!
8 changes: 4 additions & 4 deletions scripts/setup_branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ "$NPM_CHANNEL" = "dev" ]; then
echo "branch=main" >> "$GITHUB_OUTPUT"
elif [ "$NPM_CHANNEL" = "promote_patch-dev" ]; then
PATCH_BRANCH=$(node scripts/setup_branch.js "patch-dev")
git checkout stable
git checkout -f stable
git reset --hard "$PATCH_BRANCH" # Reset stable to patch-dev branch
git push -f # do not merge, only use state of PATCH_BRANCH
echo "branch=main" >> "$GITHUB_OUTPUT"
Expand All @@ -41,19 +41,19 @@ else
git config --global user.name "Prismo"

if [ "$NPM_CHANNEL" = "latest" ]; then
git checkout -b "$BRANCH"
git checkout -f -b "$BRANCH"
else
# Patch branch
NPM_VERSION=$(cat scripts/versions/prisma_latest)
echo "NPM_VERSION to base new branch on: $NPM_VERSION"
git checkout -b "$BRANCH" "$NPM_VERSION"
git checkout -f -b "$BRANCH" "$NPM_VERSION"
fi

else
echo "Not setting up repo because ENVIRONMENT is not set"
fi
else
git checkout "$BRANCH"
git checkout -f "$BRANCH"
echo "$BRANCH exists already."
echo "branch=$BRANCH" >> "$GITHUB_OUTPUT"
fi
Expand Down