Skip to content

Commit 915517b

Browse files
authored
auto bump version after release (#10)
1 parent 313bec3 commit 915517b

3 files changed

Lines changed: 37 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
- run: npm ci
2929
- run: npm run compile
3030

31+
- name: Run tests
32+
run: xvfb-run npm test
33+
3134
- name: Package VSIX
3235
run: npm run package
3336

@@ -55,3 +58,24 @@ jobs:
5558

5659
- name: Publish to VS Code Marketplace
5760
run: npx @vscode/vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ./privatemode-vscode.vsix
61+
62+
bump-version:
63+
runs-on: ubuntu-latest
64+
needs: [publish]
65+
permissions:
66+
contents: write
67+
steps:
68+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
69+
with:
70+
ref: main
71+
72+
- name: Bump minor version on main
73+
run: ./scripts/bump-minor-version.sh
74+
75+
- name: Commit and push
76+
run: |
77+
git config user.name "github-actions[bot]"
78+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
79+
git add package.json
80+
git commit -m "chore: bump version to $(jq -r .version package.json) for next release"
81+
git push

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"type": "git",
99
"url": "https://github.com/edgelesssys/privatemode-vscode"
1010
},
11-
"version": "0.1.2",
11+
"version": "0.2.0",
1212
"preview": true,
1313
"engines": {
1414
"vscode": "^1.116.0"

scripts/bump-minor-version.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
PACKAGE_JSON="${1:-package.json}"
5+
6+
CURRENT=$(jq -r .version "$PACKAGE_JSON")
7+
IFS='.' read -r MAJOR MINOR _ <<< "$CURRENT"
8+
NEXT="${MAJOR}.$((MINOR + 1)).0"
9+
10+
jq --tab --arg v "$NEXT" '.version = $v' "$PACKAGE_JSON" > tmp.$$.json && mv tmp.$$.json "$PACKAGE_JSON"
11+
12+
echo "Bumped version: ${CURRENT} -> ${NEXT}"

0 commit comments

Comments
 (0)