Skip to content

Commit 722a14c

Browse files
committed
Update CI
1 parent 1519ad1 commit 722a14c

File tree

5 files changed

+50
-28
lines changed

5 files changed

+50
-28
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "cargo"
4-
directory: "/"
5-
schedule:
6-
interval: "daily"
73
- package-ecosystem: "github-actions"
84
directory: "/"
95
schedule:

.github/workflows/ci.yml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -363,27 +363,3 @@ jobs:
363363
- name: Run nuget test
364364
run: |
365365
cmd /c "$env:VSDevCmd" "&" msbuild /m /clp:ForceConsoleColor "$env:msbuild_config_props" test\nuget\NugetTest.slnx
366-
367-
build-nuget:
368-
name: Build nuget package with MSVC
369-
runs-on: windows-2025-vs2026
370-
steps:
371-
- uses: actions/checkout@v6
372-
373-
- name: Package
374-
run: |
375-
$VSDevCmd = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" -latest -find Common7\tools\VSDevCmd.bat
376-
if (!$VSDevCmd) { exit 1 }
377-
echo "Using VSDevCmd: ${VSDevCmd}"
378-
cmd /c "${VSDevCmd}" "&" nuget.exe restore cppwinrt.slnx
379-
cmd /c "${VSDevCmd}" "&" build_nuget.cmd
380-
if (!(Test-Path "*.nupkg")) {
381-
echo "::error::Output nuget package not found!"
382-
exit 1
383-
}
384-
385-
- name: Upload nuget package artifact
386-
uses: actions/upload-artifact@v6
387-
with:
388-
name: package
389-
path: "*.nupkg"

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Release NuGet
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
permissions:
10+
id-token: write
11+
runs-on: windows-2025-vs2026
12+
steps:
13+
- uses: actions/checkout@v6
14+
15+
- name: Build and pack
16+
shell: pwsh
17+
run: |
18+
$tag = "${{ github.event.release.tag_name }}"
19+
$version = $tag -replace '^v', ''
20+
$VSDevCmd = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" -latest -find Common7\tools\VSDevCmd.bat
21+
echo "Using VSDevCmd: ${VSDevCmd}"
22+
cmd /c "${VSDevCmd}" "&" nuget.exe restore cppwinrt.slnx
23+
cmd /c "${VSDevCmd}" "&" build_nuget.cmd "${version}"
24+
if (!(Test-Path "*.nupkg")) {
25+
echo "::error::Output nuget package not found!"
26+
exit 1
27+
}
28+
29+
- name: NuGet login
30+
uses: NuGet/login@v1
31+
id: login
32+
with:
33+
user: YexuanXiao
34+
35+
- name: NuGet push
36+
run: nuget push ./*.nupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json
37+
38+
- name: Upload to Release
39+
shell: pwsh
40+
run: |
41+
$version = "${{ github.event.release.tag_name }}"
42+
$headers = @{
43+
"Authorization" = "Bearer ${{ secrets.GITHUB_TOKEN }}"
44+
"Content-Type" = "application/octet-stream"
45+
}
46+
Get-ChildItem "./*.nupkg" | ForEach-Object {
47+
$url = "https://uploads.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets?name=$($_.Name)"
48+
Invoke-RestMethod -Uri $url -Method POST -Headers $headers -InFile $_.FullName
49+
}

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
MIT License
22

33
Copyright (c) Microsoft Corporation.
4+
Copyright (c) 2026 YexuanXiao and The C++/WinRT Plus Project.
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)