Skip to content

Commit 5d4858e

Browse files
Copilotdibarbet
andcommitted
Update GitHub workflow and documentation for new versioning scheme
Co-authored-by: dibarbet <5749229+dibarbet@users.noreply.github.com>
1 parent 38e9e76 commit 5d4858e

File tree

2 files changed

+50
-3
lines changed

2 files changed

+50
-3
lines changed

.github/workflows/branch-snap.yml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Branch snap
22
on:
3-
workflow_dispatch
3+
workflow_dispatch:
4+
inputs:
5+
releaseCandidate:
6+
description: 'Is this a release candidate snap from main? (Will increment main version to be higher than next stable release)'
7+
required: false
8+
default: 'false'
9+
type: boolean
410

511
permissions:
612
contents: write
@@ -26,11 +32,42 @@ jobs:
2632
- name: Install dependencies
2733
run: npm ci
2834
- name: Update version.json
29-
run: npx gulp incrementVersion
35+
run: |
36+
if [ "${{ github.event.inputs.releaseCandidate }}" = "true" ]; then
37+
npx gulp incrementVersion --releaseCandidate=true
38+
else
39+
npx gulp incrementVersion
40+
fi
3041
- name: Create version update PR
3142
uses: peter-evans/create-pull-request@v4
3243
with:
3344
token: ${{ secrets.GITHUB_TOKEN }}
3445
commit-message: Update main version
3546
title: '[automated] Update main version'
3647
branch: merge/update-main-version
48+
49+
update-release-version:
50+
needs: check-script
51+
if: github.ref == 'refs/heads/prerelease'
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Check out merge branch
55+
uses: actions/checkout@v2
56+
with:
57+
ref: merge/prerelease-to-release
58+
fetch-depth: 0
59+
- name: Install NodeJS
60+
uses: actions/setup-node@v4
61+
with:
62+
node-version: '18.x'
63+
- name: Install dependencies
64+
run: npm ci
65+
- name: Update version.json for release
66+
run: npx gulp updateVersionForRelease
67+
- name: Commit and push version update
68+
run: |
69+
git config --local user.name "github-actions[bot]"
70+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
71+
git add version.json
72+
git commit -m "Update version for stable release"
73+
git push

CONTRIBUTING.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,25 @@ More details for this are [here] (https://devdiv.visualstudio.com/DevDiv/_git/Vi
196196
## Snapping for releases
197197
Extension releases on the marketplace are done from the prerelease and release branches (corresponding to the prerelease or release version of the extension). Code flows from main -> prerelease -> release. Every week we snap main -> prerelease. Monthly, we snap prerelease -> release.
198198

199+
### Versioning Scheme
200+
The extension follows a specific versioning scheme for releases:
201+
- **Prerelease versions**: Use standard minor version increments (e.g., 2.74, 2.75, 2.76...)
202+
- **Stable release versions**: Use the next tens version (e.g., 2.74 prerelease becomes 2.80 stable)
203+
- **Main branch after RC snap**: Jumps to one above the next stable version (e.g., if snapping 2.74 as RC, main becomes 2.81)
204+
199205
### Snap main -> prerelease
200206
The snap is done via the "Branch snap" github action. To run the snap from main -> prerelease, run the action via "Run workflow" and choose main as the base branch.
201207
![branch snap action](./docs/images/main_snap.png)
202208

209+
When running the snap action, you can optionally check the "Is this a release candidate snap" checkbox. If checked:
210+
- The prerelease branch will receive the snapped code with the current version (e.g., 2.74)
211+
- The main branch version will be updated to be higher than the next stable release (e.g., 2.81, since the next stable would be 2.80)
212+
203213
This will generate two PRs that must be merged. One merging the main branch into prerelease, and the other bumps the version in main.
204214
![generated prs](./docs/images/generated_prs.png)
205215

206216
### Snap prerelease -> release
207-
To snap from prerelease to release, run the same action but use **prerelease** as the workflow branch. This will generate a single PR merging from prerelease to release.
217+
To snap from prerelease to release, run the same action but use **prerelease** as the workflow branch. This will generate a PR merging from prerelease to release, and automatically update the version to the next stable release version (e.g., 2.74 -> 2.80) on the merge branch before the PR is merged.
208218

209219
### Marketplace release
210220
The marketplace release is managed by an internal AzDo pipeline. On the pipeline page, hit run pipeline. This will bring up the pipeline parameters to fill out:

0 commit comments

Comments
 (0)