Svelte #589
Workflow file for this run
This file contains 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: 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 run ci:all | |
npm install -g @vscode/vsce | |
npm run webpack | |
vsce package ${{ 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 }} |