Update README.md #19
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: Release | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install Node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14 | |
- name: Cache node_modules | |
id: cache-node-modules | |
uses: actions/cache@v2 | |
with: | |
path: | | |
**/node_modules | |
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | |
- name: Install Dependencies | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: npm install | |
- name: Check version validity | |
if: ${{ github.base_ref == 'master' }} | |
run: | | |
export EXTENSION_ID=$(jq -r '.publisher' package.json).$(jq -r '.name' package.json) | |
export PACKAGE_VERSION=$(jq -r '.version' package.json) | |
export MARKETPLACE_VERSION=$(npx vsce show $EXTENSION_ID --json | jq -j '.versions[0].version') | |
dpkg --compare-versions $PACKAGE_VERSION "gt" $MARKETPLACE_VERSION | |
- name: Publish extension | |
run: npx vsce publish | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} |