Skip to content

VSCode Extension

VSCode Extension #476

Workflow file for this run

name: VSCode Extension
env:
IDE_TOOLS_RELEASE_VERSION: 2.0.0
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-vscode:
runs-on: windows-latest
name: Build VSCode Extension
steps:
- name: Checkout current repo
uses: actions/checkout@v4
with:
path: main
submodules: true
- if: ${{ github.ref == 'refs/heads/main' }}
name: Checkout Meadow.CLI.Core side-by-side
uses: actions/checkout@v4
with:
repository: WildernessLabs/Meadow.CLI
path: Meadow.CLI
ref: main
- if: ${{ github.ref != 'refs/heads/main' }}
name: Checkout Meadow.CLI.Core side-by-side
uses: actions/checkout@v4
with:
repository: WildernessLabs/Meadow.CLI
path: Meadow.CLI
ref: dominique-TestDebugging
- name: Checkout Meadow.Contracts side-by-side
uses: actions/checkout@v4
with:
repository: WildernessLabs/Meadow.Contracts
path: Meadow.Contracts
ref: main
- name: Setup .NET 8.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
- name: Setup Nuget
uses: Nuget/setup-nuget@v2
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install vsce
run: |
npm i -g @vscode/vsce
npm i -g @vscode/debugprotocol
- if: ${{ github.event_name == 'workflow_dispatch' }}
name: Update VSCode Version Numbers
run: |
$content = Get-Content main/package.json | Out-String
$newcontent = $content -replace '"version": "1.*",', '"version": "${{ENV.IDE_TOOLS_RELEASE_VERSION}}",'
$newcontent | Set-Content main/package.json
- name: Restore VSCode Extension dependencies
run: |
dotnet restore main/src/csharp/VSCodeMeadow.csproj -p:Configuration=Debug -v:diag -bl:restore.binlog
- name: Build VSCode Extension
id: VSCode-Extension
run: dotnet build main/src/csharp/VSCodeMeadow.csproj -p:Configuration=Debug -v:diag -bl:build.binlog
- name: Build WebPack
run: |
cd main
npm install -g webpack
npm install -D ts-loader
npm run webpack
- if: ${{ github.ref != 'refs/heads/main' }}
name: Build Pre-Release VSIX on non main branch
run: |
cd main
vsce package --pre-release
- if: ${{ github.ref == 'refs/heads/main' }}
name: Build Release VSIX on main branch
run: |
cd main
vsce package
- name: Upload VSIX Artifacts
uses: actions/upload-artifact@v4
with:
name: VSCodeMeadow.vsix.${{ ENV.IDE_TOOLS_RELEASE_VERSION }}
path: 'main/*.vsix'
- name: Upload Binlog Artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: BinLogs
path: '**/*.binlog'
- if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
name: Publish VSCode Extension
run: |
cd main
vsce publish -p ${{ secrets.MARKETPLACE_PUBLISH_PAT }}