From f5f4d9b32cda60a2b31d97817b8517a46bc5cc29 Mon Sep 17 00:00:00 2001 From: Roxk Date: Thu, 28 Mar 2024 00:03:42 +0800 Subject: [PATCH] Add extension script and CI --- .github/workflows/ci.yaml | 16 +++++++++++++++- README.md | 1 + extensions/WinUI3XamlPreviewVS2022/README.md | 8 ++++++++ .../source.extension.vsixmanifest | 7 ++++--- .../scripts/build-extension.ps1 | 14 ++++++++++++++ .../WinUI3XamlPreviewVS2022/vs-publish.json | 12 ++++++++++++ 6 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 extensions/WinUI3XamlPreviewVS2022/README.md create mode 100644 extensions/WinUI3XamlPreviewVS2022/scripts/build-extension.ps1 create mode 100644 extensions/WinUI3XamlPreviewVS2022/vs-publish.json diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index dfdbbed..32c63a2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: build: runs-on: windows-2022 needs: ["test"] - if: startsWith(github.ref, 'refs/tags') + if: startsWith(github.ref, 'refs/tags/v') env: VERSION: 0.1.0 NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} @@ -29,3 +29,17 @@ jobs: run: | ./scripts/build -version $env:VERSION ./scripts/publish-nuget -version $env:VERSION + build-extension: + runs-on: windows-2022 + needs: ["test"] + if: startsWith(github.ref, 'refs/tags/vs2022-v') + steps: + - uses: actions/checkout@v3 + - uses: microsoft/setup-msbuild@v1.1 + - working-directory: extensions/WinUI3XamlPrevieVS2022 + run: ./scripts/build-extension -config Release + - uses: cezarypiatek/VsixPublisherAction@0.2 + with: + extension-file: './extensions/WinUI3XamlPrevieVS2022/WinUI3XamlPrevieVS2022/bin/Release/net480/WinUI3XamlPrevieVS2022.vsix' + publish-manifest-file: './extension/WinUI3XamlPrevieVS2022/vs-publish.json' + personal-access-code: ${{ secrets.VS_MARKETPLACE_API_KEY }} \ No newline at end of file diff --git a/README.md b/README.md index f10f69a..2af2afc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # WinUI 3 Xaml Preview (WinUI3XP) [![nuget](https://img.shields.io/nuget/v/WinUI3XamlPreview)](https://www.nuget.org/packages/WinUI3XamlPreview/) +[![VS2022](https://img.shields.io/visual-studio-marketplace/v/Roxk.winui3xamlpreview.svg?label=Visual%20Studio%202022%20(Preview))](https://marketplace.visualstudio.com/items?itemName=Roxk.winui3xamlpreview) [![CI](https://github.com/roxk/WinUI3XamlPreview/actions/workflows/ci.yaml/badge.svg)](https://github.com/roxk/WinUI3XamlPreview/actions/workflows/ci.yaml) WinUI3 Xaml Preview allows you to see a a live preview of your UI while authoring XAML. It is fast, reliable, and comes with basic tools like scaling and size configuration. diff --git a/extensions/WinUI3XamlPreviewVS2022/README.md b/extensions/WinUI3XamlPreviewVS2022/README.md new file mode 100644 index 0000000..aa6a5b1 --- /dev/null +++ b/extensions/WinUI3XamlPreviewVS2022/README.md @@ -0,0 +1,8 @@ +# Welcome to WinUI3 Xaml Preview Extension + +## Prerequisite +- [WinUI3XamlPreview](https://www.nuget.org/packages/WinUI3XamlPreview/) nuget on nuget gallery. + +## Getting started + +Refer to the readme in https://github.com/roxk/WinUI3XamlPreview for more instructions. \ No newline at end of file diff --git a/extensions/WinUI3XamlPreviewVS2022/WinUI3XamlPreviewVS2022/source.extension.vsixmanifest b/extensions/WinUI3XamlPreviewVS2022/WinUI3XamlPreviewVS2022/source.extension.vsixmanifest index 31c525a..e769afe 100644 --- a/extensions/WinUI3XamlPreviewVS2022/WinUI3XamlPreviewVS2022/source.extension.vsixmanifest +++ b/extensions/WinUI3XamlPreviewVS2022/WinUI3XamlPreviewVS2022/source.extension.vsixmanifest @@ -1,9 +1,10 @@ - - WinUI3XamlPreviewVS2022 - VisualStudio.Extensibility Extension with VSSDK Compatibility. + + WinUI3XamlPreview VS2022 Extension + This extension allows developers to see a live preview while writing XAML in WinUI 3 + WinUI3, WinUI 3, WinUI, XAML, Preview, Live Preview true diff --git a/extensions/WinUI3XamlPreviewVS2022/scripts/build-extension.ps1 b/extensions/WinUI3XamlPreviewVS2022/scripts/build-extension.ps1 new file mode 100644 index 0000000..3d77ab0 --- /dev/null +++ b/extensions/WinUI3XamlPreviewVS2022/scripts/build-extension.ps1 @@ -0,0 +1,14 @@ +param( + [boolean]$buildClang, + [string]$config +) + +if (!($config -eq "Release" -or $config -eq "Debug")) { + echo "Uknown config: $config. -config [Release|Debug]" + exit 1 +} + +$srcDir = "$PSScriptRoot" +$solutionDir = "$srcDir\.." +msbuild "${solutionDir}WinUI3XamlPreviewVS2022\WinUI3XamlPreviewVS2022.csproj" -restore +msbuild $solutionDir -t:WinUI3XamlPreviewVS2022 -p:Configuration=$config diff --git a/extensions/WinUI3XamlPreviewVS2022/vs-publish.json b/extensions/WinUI3XamlPreviewVS2022/vs-publish.json new file mode 100644 index 0000000..16f2042 --- /dev/null +++ b/extensions/WinUI3XamlPreviewVS2022/vs-publish.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json.schemastore.org/vsix-publish", + "categories": [ "programming languages" ], + "identity": { + "internalName": "winui3xamlpreview", + "tags": [ "WinUI3", "WinUI 3", "WinUI", "XAML", "Preview", "Live Preview" ] + }, + "assetFiles": [], + "overview": "README.md", + "publisher": "Roxk", + "repo": "https://github.com/roxk/WinUI3XamlPreview" +}