Skip to content

Commit bd1fcfc

Browse files
Add Nuget publish job with Trusted Publishing (test registry)
1 parent b1252b2 commit bd1fcfc

1 file changed

Lines changed: 45 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,48 @@ jobs:
5959
generate_release_notes: true
6060
prerelease: true
6161
draft: true
62-
make_latest: true
62+
make_latest: true
63+
64+
publish-nuget:
65+
if: startsWith(github.ref, 'refs/tags/')
66+
needs: build
67+
runs-on: ubuntu-latest
68+
permissions:
69+
id-token: write # enable GitHub OIDC token issuance for this job
70+
71+
steps:
72+
- name: Checkout repository
73+
uses: actions/checkout@v4
74+
75+
- name: Setup .NET
76+
uses: actions/setup-dotnet@v4
77+
with:
78+
dotnet-version: '10.0.x'
79+
80+
- name: Pack NuGet package
81+
working-directory: src/ucll.build
82+
run: |
83+
PACK_DIR=bin/pack
84+
BUILD_DIR=$PACK_DIR/build
85+
dotnet pack ../ucll/ucll.csproj \
86+
-p:PackAsTool=true \
87+
-p:ToolCommandName=ucll \
88+
-p:PackageId=UnityCommandLineLauncher \
89+
-p:Authors="Chris Yarbrough" \
90+
-p:PackageLicenseExpression=MIT \
91+
-p:PackageReadmeFile=README.md \
92+
-p:PackageTags="Unity CLI Hub" \
93+
-p:RepositoryUrl=https://github.com/chrisyarbrough/UnityCommandLineLauncher \
94+
-p:RepositoryType=git \
95+
-p:OutputPath=$BUILD_DIR \
96+
-p:PublishDir=$BUILD_DIR \
97+
--output ../ucll/$PACK_DIR
98+
99+
- name: NuGet login (OIDC → temp API key)
100+
uses: NuGet/login@v1
101+
id: login
102+
with:
103+
user: ${{ secrets.NUGET_USER }}
104+
105+
- name: NuGet push
106+
run: dotnet nuget push src/ucll/bin/pack/UnityCommandLineLauncher.*.nupkg --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://apiint.nugettest.org/v3/index.json

0 commit comments

Comments
 (0)