Skip to content

Publish to Marketplace #42

Publish to Marketplace

Publish to Marketplace #42

name: "Publish to Marketplace"
on:
workflow_run:
workflows: ["CI"]
types: [completed]
branches: [master]
jobs:
cd:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout to branch
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup node.js
uses: actions/setup-node@v4
- name: "Bump version"
uses: "phips28/gh-action-bump-version@master"
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
with:
minor-wording: "MINOR"
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: Compile
run: npm run build
- name: Build VSIX package
run: npm run package -- -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