Merge pull request #729 from rage/warn-open #671
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: [22.x] | |
env: | |
PRERELEASE: ${{ endsWith ( github.event.release.tag_name, '-prerelease' ) && '--pre-release' || '' }} | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
with: | |
submodules: "true" | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/[email protected] | |
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/[email protected] | |
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 }} |