Skip to content

Commit 2c396cf

Browse files
authored
chore: fix patch release CI (#1838)
1 parent 71e1d5d commit 2c396cf

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

.github/workflows/1_2_b_bump_extension_only.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ jobs:
2929
with:
3030
node-version: '20'
3131
cache: 'npm'
32-
- name: Install Dependencies
33-
run: npm install && npm run bootstrap
34-
shell: bash
3532
- name: checkout main if necessary
3633
if: endsWith(github.ref, '/main') == false
3734
run: git fetch && git checkout main
35+
- name: Install Dependencies
36+
run: npm install && npm run bootstrap
37+
shell: bash
3838
- name: Setup Git
3939
run: |
4040
sh scripts/set_git_credentials.sh
@@ -47,7 +47,7 @@ jobs:
4747
4848
- name: Checkout previous branch
4949
if: endsWith(github.ref, '/main') == false
50-
run: git checkout ${{ github.ref_name }}
50+
run: git checkout -f ${{ github.ref_name }}
5151
- name: Update VS Code extension version
5252
run: |
5353
node scripts/update_package_json_files.js dev ${{ steps.update.outputs.next_extension_version }} ""

.github/workflows/1_2_c_promote_patch_to_stable.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
with:
2424
node-version: '20'
2525
cache: 'npm'
26-
- name: Install Dependencies
27-
run: npm install && npm run bootstrap
2826
- name: Checkout main
2927
run: git fetch && git checkout main
28+
- name: Install Dependencies
29+
run: npm install && npm run bootstrap
3030
- name: Setup Git
3131
run: |
3232
sh scripts/set_git_credentials.sh

packages/vscode/CONTRIBUTING.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,11 @@ Note that the personal access token is only valid for a year and will need to be
183183

184184
### Manual Publishing
185185

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

188-
1. Create a patch branch ending with `.x` if it doesn't exist yet.
188+
1. Create a patch branch ending with `.x` (e.g. `6.7.x`) if it doesn't exist yet.
189189
2. Push to the patch branch with the changes.
190-
3. Step 2 will trigger the script `patch-extension-only`, creating an Insider release
191-
4. If you were satisfied, manually trigger GH action workflow `publish-patch-branch-to-stable` to release the patch to the stable extension
190+
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.
191+
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.
192+
193+
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!

scripts/setup_branch.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if [ "$NPM_CHANNEL" = "dev" ]; then
1818
echo "branch=main" >> "$GITHUB_OUTPUT"
1919
elif [ "$NPM_CHANNEL" = "promote_patch-dev" ]; then
2020
PATCH_BRANCH=$(node scripts/setup_branch.js "patch-dev")
21-
git checkout stable
21+
git checkout -f stable
2222
git reset --hard "$PATCH_BRANCH" # Reset stable to patch-dev branch
2323
git push -f # do not merge, only use state of PATCH_BRANCH
2424
echo "branch=main" >> "$GITHUB_OUTPUT"
@@ -41,19 +41,19 @@ else
4141
git config --global user.name "Prismo"
4242

4343
if [ "$NPM_CHANNEL" = "latest" ]; then
44-
git checkout -b "$BRANCH"
44+
git checkout -f -b "$BRANCH"
4545
else
4646
# Patch branch
4747
NPM_VERSION=$(cat scripts/versions/prisma_latest)
4848
echo "NPM_VERSION to base new branch on: $NPM_VERSION"
49-
git checkout -b "$BRANCH" "$NPM_VERSION"
49+
git checkout -f -b "$BRANCH" "$NPM_VERSION"
5050
fi
5151

5252
else
5353
echo "Not setting up repo because ENVIRONMENT is not set"
5454
fi
5555
else
56-
git checkout "$BRANCH"
56+
git checkout -f "$BRANCH"
5757
echo "$BRANCH exists already."
5858
echo "branch=$BRANCH" >> "$GITHUB_OUTPUT"
5959
fi

0 commit comments

Comments
 (0)