Skip to content

Commit 28ff1aa

Browse files
committed
chore: add nuget trusted publishing
1 parent 1a5a276 commit 28ff1aa

15 files changed

Lines changed: 1070 additions & 1070 deletions

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ jobs:
2929
uses: actions/upload-artifact@v4
3030
with:
3131
name: build-output
32-
path: src/Otel4Vsix/bin/Release/
32+
path: src/CodingWithCalvin.Otel4Vsix/bin/Release/net48
3333
retention-days: 7

.github/workflows/publish.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717

1818
permissions:
1919
contents: write
20+
id-token: write
2021

2122
steps:
2223
- name: Checkout
@@ -57,5 +58,16 @@ jobs:
5758
./nupkg/*.nupkg
5859
./nupkg/*.snupkg
5960
61+
# Get a short-lived NuGet API key
62+
- name: NuGet login (OIDC → temp API key)
63+
uses: NuGet/login@v1
64+
id: login
65+
with:
66+
user: ${{ secrets.NUGET_USERNAME }}
67+
6068
- name: Push to NuGet
61-
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
69+
run: |
70+
Get-ChildItem ./nupkg/*.nupkg | ForEach-Object {
71+
dotnet nuget push $_.FullName --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate
72+
}
73+
shell: pwsh

src/CodingWithCalvin.Otel4Vsix/CodingWithCalvin.Otel4Vsix.csproj

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
<PropertyGroup>
55
<TargetFramework>net48</TargetFramework>
66
<LangVersion>latest</LangVersion>
7-
<RootNamespace>Otel4Vsix</RootNamespace>
8-
<AssemblyName>Otel4Vsix</AssemblyName>
7+
<RootNamespace>CodingWithCalvin.Otel4Vsix</RootNamespace>
8+
<AssemblyName>CodingWithCalvin.Otel4Vsix</AssemblyName>
99
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
1010

1111
<!-- NuGet Package Properties -->
1212
<PackageId>CodingWithCalvin.Otel4Vsix</PackageId>
13-
<Version>1.0.0</Version>
13+
<Version>0.0.1</Version>
1414
<Authors>Calvin A. Allen</Authors>
1515
<Company>Coding With Calvin</Company>
16-
<Product>Otel4Vsix</Product>
16+
<Product>CodingWithCalvin.Otel4Vsix</Product>
1717
<Description>OpenTelemetry support library for Visual Studio 2022+ extensions. Provides tracing, metrics, logging, and exception tracking capabilities.</Description>
1818
<PackageTags>OpenTelemetry;VisualStudio;VSIX;Telemetry;Tracing;Metrics;Logging</PackageTags>
1919
<PackageLicenseExpression>MIT</PackageLicenseExpression>
@@ -23,8 +23,6 @@
2323
<RepositoryUrl>https://github.com/CodingWithCalvin/Otel4Vsix</RepositoryUrl>
2424
<ProjectUrl>https://github.com/CodingWithCalvin/Otel4Vsix</ProjectUrl>
2525
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
26-
<IncludeSymbols>true</IncludeSymbols>
27-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2826

2927
<!-- Documentation -->
3028
<GenerateDocumentationFile>true</GenerateDocumentationFile>

0 commit comments

Comments
 (0)