Skip to content

3.0.4

3.0.4 #651

name: Build and Upload
on:
push:
branches: [master]
pull_request:
branches: [master]
release:
types:
- created
jobs:
build_and_upload:
name: Build and Upload
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
env:
PRERELEASE: ${{ endsWith ( github.event.release.tag_name, '-prerelease' ) && '--pre-release' || '' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: "true"
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Package extension
run: |
npm install -g @vscode/vsce
chmod +x bin/package.bash
bin/package.bash ${{ env.PRERELEASE }}
# move packaged extension from project root to own release folder
mkdir extension && mv *.vsix extension
env:
CI: true
- name: Upload artifact
uses: actions/upload-artifact@v3
if: success()
with:
name: packaged-extension
path: extension/
- name: Publish to Visual Studio Marketplace
if: success() && github.event_name == 'release'
run: |
chmod +x bin/validateRelease.sh
bin/validateRelease.sh ${{ github.event.release.tag_name }}
vsce publish -p ${{ secrets.VSCE_PUBLISH_TOKEN }} ${{ env.PRERELEASE }} --packagePath extension/*.vsix
- name: Publish to Open VSX Marketplace
if: success() && github.event_name == 'release'
run: |
npx ovsx publish extension/*.vsix -p ${{ secrets.OVSX_PUBLISHER_TOKEN }} ${{ env.PRERELEASE }}