diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7cc1083..42ef586 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,6 +28,9 @@ jobs: - run: npm ci - run: npm run compile + - name: Run tests + run: xvfb-run npm test + - name: Package VSIX run: npm run package @@ -55,3 +58,24 @@ jobs: - name: Publish to VS Code Marketplace run: npx @vscode/vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ./privatemode-vscode.vsix + + bump-version: + runs-on: ubuntu-latest + needs: [publish] + permissions: + contents: write + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + ref: main + + - name: Bump minor version on main + run: ./scripts/bump-minor-version.sh + + - name: Commit and push + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add package.json + git commit -m "chore: bump version to $(jq -r .version package.json) for next release" + git push diff --git a/package.json b/package.json index acb84e5..6c0cee7 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "type": "git", "url": "https://github.com/edgelesssys/privatemode-vscode" }, - "version": "0.1.2", + "version": "0.2.0", "preview": true, "engines": { "vscode": "^1.116.0" diff --git a/scripts/bump-minor-version.sh b/scripts/bump-minor-version.sh new file mode 100755 index 0000000..2d29986 --- /dev/null +++ b/scripts/bump-minor-version.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -euo pipefail + +PACKAGE_JSON="${1:-package.json}" + +CURRENT=$(jq -r .version "$PACKAGE_JSON") +IFS='.' read -r MAJOR MINOR _ <<< "$CURRENT" +NEXT="${MAJOR}.$((MINOR + 1)).0" + +jq --tab --arg v "$NEXT" '.version = $v' "$PACKAGE_JSON" > tmp.$$.json && mv tmp.$$.json "$PACKAGE_JSON" + +echo "Bumped version: ${CURRENT} -> ${NEXT}"