Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/build-vsix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Builds the Json5.VisualStudio VSIX extension on Windows

name: build-vsix
on:
workflow_dispatch:
inputs:
configuration:
type: choice
description: Configuration
options:
- Release
- Debug
push:
branches: [ main, 'feature/*', 'rel/*' ]
paths-ignore:
- changelog.md
- readme.md
pull_request:
types: [opened, synchronize, reopened]

env:
DOTNET_NOLOGO: true
PackOnBuild: true
VersionPrefix: 42.42.${{ github.run_number }}
VersionLabel: ${{ github.ref }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
MSBUILDTERMINALLOGGER: auto
Configuration: ${{ github.event.inputs.configuration || 'Release' }}

defaults:
run:
shell: bash

jobs:
build:
runs-on: windows-latest
steps:
- name: 🤘 checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: ⚙ dotnet
uses: devlooped/actions-dotnet-env@v1

- name: 🙏 build
run: dotnet msbuild src/Json5.VisualStudio/Json5.VisualStudio.csproj -m:1 -bl:build.binlog

- name: 🐛 logs
uses: actions/upload-artifact@v4
if: runner.debug && always()
with:
name: logs
path: '*.binlog'
46 changes: 46 additions & 0 deletions .github/workflows/publish-vsix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Builds and publishes the Json5.VisualStudio VSIX extension to the GitHub release
# whenever a release is published.
# Requires: secrets.GH_TOKEN

name: publish-vsix
on:
release:
types: [prereleased, released]

env:
DOTNET_NOLOGO: true
Configuration: Release
PackOnBuild: true
VersionLabel: ${{ github.ref }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
MSBUILDTERMINALLOGGER: auto

defaults:
run:
shell: bash

jobs:
publish:
runs-on: windows-latest
steps:
- name: 🤘 checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: ⚙ dotnet
uses: devlooped/actions-dotnet-env@v1

- name: 🙏 build
run: dotnet msbuild src/Json5.VisualStudio/Json5.VisualStudio.csproj -m:1 -bl:build.binlog

- name: 🐛 logs
uses: actions/upload-artifact@v4
if: runner.debug && always()
with:
name: logs
path: '*.binlog'

- name: 📦 release assets
run: gh release upload ${{ github.ref_name }} bin/*.vsix --clobber
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
run: dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate

- name: 📦 release assets
run: gh release upload ${{ github.ref_name }} bin/*.nupkg bin/**/*.vsix --clobber
run: gh release upload ${{ github.ref_name }} bin/*.nupkg --clobber

- name: 🚀 sleet
env:
Expand Down
1 change: 0 additions & 1 deletion Json5.slnx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Solution>
<Project Path="src/Json5.Configuration/Json5.Configuration.csproj" />
<Project Path="src/Json5.VisualStudio/Json5.VisualStudio.csproj" Id="c1cacf43-b1ec-4d67-82fe-17cfb28bec30" />
<Project Path="src/Json5/Json5.csproj" />
<Project Path="src/Tests/Tests.csproj" />
</Solution>
10 changes: 10 additions & 0 deletions src/Json5.VisualStudio/Json5.VisualStudio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
<CreateVsixContainer>$(PackOnBuild)</CreateVsixContainer>
</PropertyGroup>

<PropertyGroup Label="VSIX Path Fixup" Condition="$(VsSDKInstall) != ''">
<VsSDKInstall>$(VsSDKInstall.ToLowerInvariant())</VsSDKInstall>
<VsSDKIncludes>$(VsSDKInstall)\inc</VsSDKIncludes>
<VsSDKToolsPath>$(VsSDKInstall)\bin</VsSDKToolsPath>
<VsSDKX86ToolsPath>$(VsSDKInstall)\bin\x86</VsSDKX86ToolsPath>
<VsSDKARM64ToolsPath>$(VsSDKInstall)\bin\arm64</VsSDKARM64ToolsPath>
<CustomAfterMicrosoftCSharpTargets>$(VsSDKInstall)\Microsoft.VsSDK.targets</CustomAfterMicrosoftCSharpTargets>
</PropertyGroup>

<PropertyGroup>
<!-- Enables F5 -->
<StartAction>Program</StartAction>
Expand All @@ -33,6 +42,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.14.40265" />
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.14.2142" PrivateAssets="all" />
</ItemGroup>
Expand Down
24 changes: 0 additions & 24 deletions src/Json5.VisualStudio/Json5.VisualStudio.sln

This file was deleted.

Loading