Skip to content

Support for pre-release versions #477

Support for pre-release versions

Support for pre-release versions #477

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.ref, "-prerelease" ) && "--pre-release" || "" }}

Check failure on line 20 in .github/workflows/build-and-upload.yml

View workflow run for this annotation

GitHub Actions / Build and Upload

Invalid workflow file

The workflow is not valid. .github/workflows/build-and-upload.yml (Line: 20, Col: 25): Unexpected symbol: '"-prerelease"'. Located at position 24 within expression: endsWith ( github.ref, "-prerelease" ) && "--pre-release" || "" .github/workflows/build-and-upload.yml (Line: 46, Col: 19): Unexpected symbol: '"release"'. Located at position 22 within expression: github.event_name == "release"
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
submodules: "true"
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Package extension
run: |
npm run ci:all
npm install -g @vscode/vsce
vsce package
# 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@v1
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.ref }}
vsce publish -p ${{ secrets.VSCE_PUBLISH_TOKEN }} ${{ 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 }} ${{ PRERELEASE }}