Skip to content

Commit

Permalink
Add extension script and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
roxk committed Mar 27, 2024
1 parent 0afb28b commit f5f4d9b
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 4 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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/[email protected]
- working-directory: extensions/WinUI3XamlPrevieVS2022
run: ./scripts/build-extension -config Release
- uses: cezarypiatek/[email protected]
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 }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
8 changes: 8 additions & 0 deletions extensions/WinUI3XamlPreviewVS2022/README.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="WinUI3XamlPreviewVS2022.419c3506-e387-4816-bc98-50b888b96498" Version="1.0" Language="en-US" Publisher="Publisher name" />
<DisplayName>WinUI3XamlPreviewVS2022</DisplayName>
<Description>VisualStudio.Extensibility Extension with VSSDK Compatibility.</Description>
<Identity Id="WinUI3XamlPreviewVS2022.419c3506-e387-4816-bc98-50b888b96498" Version="0.1.0" Language="en-US" Publisher="Roxk Yiu" />
<DisplayName>WinUI3XamlPreview VS2022 Extension</DisplayName>
<Description>This extension allows developers to see a live preview while writing XAML in WinUI 3</Description>
<Tags>WinUI3, WinUI 3, WinUI, XAML, Preview, Live Preview</Tags>
<Preview>true</Preview>
</Metadata>
<Installation ExtensionType="VSSDK+VisualStudio.Extensibility">
Expand Down
14 changes: 14 additions & 0 deletions extensions/WinUI3XamlPreviewVS2022/scripts/build-extension.ps1
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions extensions/WinUI3XamlPreviewVS2022/vs-publish.json
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit f5f4d9b

Please sign in to comment.