Setup version bump action #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Publish to VS Code Marketplace" | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
cd: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout to branch | ||
uses: actions/checkout@v4 | ||
- name: Setup node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- name: "Bump version" | ||
uses: 'phips28/gh-action-bump-version@master' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} | ||
minor-wording: '#add' | ||
Check failure on line 24 in .github/workflows/publish-extension.yml
|
||
major-wording: '#major' | ||
patch-wording: '#patch,#fix' | ||
rc-wording: '#release' | ||
- name: Install packages | ||
run: npm ci | ||
- name: Calculate version | ||
id: calculateVersion | ||
run: | | ||
APP_VERSION=`cat package.json | jq ".version" -M | sed 's/\"//g'` | ||
echo "AppVersion=$APP_VERSION" >> $GITHUB_OUTPUT | ||
echo "app version = v$APP_VERSION" | ||
- name: Build VSIX package | ||
run: npm run build -- -o vscode-string-manipulation.v${{ steps.calculateVersion.outputs.AppVersion }}.vsix | ||
- name: Publish extension package | ||
env: | ||
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }} | ||
run: npm run vsce -- publish -p $VSCE_TOKEN | ||
- uses: actions/upload-artifact@v4 | ||
name: Upload artifact | ||
with: | ||
name: vscode-string-manipulation.v${{ steps.calculateVersion.outputs.AppVersion }}.vsix | ||
path: vscode-string-manipulation.v${{ steps.calculateVersion.outputs.AppVersion }}.vsix |