Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

Commit c63aacd

Browse files
committed
chore: publish to nuget.org instead of GitHub Packages
GitHub Packages required every consumer to ship a NuGet.config with GITHUB_ACTOR/GITHUB_PACKAGES_TOKEN credentials, and Renovate's default lookup couldn't see the package at all (it queries nuget.org). For an open-source Nuke component package on a public repo, GitHub Packages was the wrong feed. Changes: - name: "Publish to NuGet.org" (was "Publish to GitHub Packages (NuGet)") - drop packages: write permission (no longer needed) - drop environment: github-packages (the env was protection-rules scaffolding for a private feed; nuget.org auth is the API key alone) - replace the GitHub Packages source + push steps with a single dotnet nuget push to https://api.nuget.org/v3/index.json - secret: NUGET_ORG_API_KEY (scoped to Nuke.OpenTelemetry.Conventions*, Push new packages and package versions, 365-day expiry) Re-publish v0.1.0 via workflow_dispatch with version=0.1.0 after merge. Consumer cleanup (delete build/NuGet.config, drop GH Packages refs in AGENTS.md/README.md) ships in a sibling PR on ANcpLua.OtelConventions.Api.
1 parent 2ecc235 commit c63aacd

1 file changed

Lines changed: 7 additions & 16 deletions

File tree

.github/workflows/publish.yml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
name: Publish to GitHub Packages (NuGet)
1+
name: Publish to NuGet.org
22

33
on:
44
release:
55
types: [published]
66
workflow_dispatch:
77
inputs:
88
version:
9-
description: 'Override package version (semver, e.g. 0.1.0). Leave blank to use the csproj version.'
9+
description: 'Override package version (semver, e.g. 0.1.0). Leave blank to use the release tag.'
1010
required: false
1111
default: ''
1212

1313
permissions:
1414
contents: read
15-
packages: write # required to publish to GitHub Packages NuGet feed
1615
id-token: write # reserved for future NuGet provenance attestations
1716

1817
concurrency:
@@ -22,7 +21,6 @@ concurrency:
2221
jobs:
2322
publish:
2423
runs-on: ubuntu-latest
25-
environment: github-packages
2624
steps:
2725
- uses: actions/checkout@v6
2826

@@ -68,18 +66,11 @@ jobs:
6866
/p:Version=$PKG_VERSION \
6967
/p:ContinuousIntegrationBuild=true
7068
71-
- name: Add GitHub Packages NuGet source
72-
run: |
73-
dotnet nuget add source \
74-
"https://nuget.pkg.github.com/O-ANcppLua/index.json" \
75-
--name github \
76-
--username "${{ github.actor }}" \
77-
--password "${{ secrets.GITHUB_TOKEN }}" \
78-
--store-password-in-clear-text
79-
80-
- name: Push .nupkg + .snupkg to GitHub Packages
69+
- name: Push .nupkg + .snupkg to nuget.org
70+
env:
71+
NUGET_ORG_API_KEY: ${{ secrets.NUGET_ORG_API_KEY }}
8172
run: |
8273
dotnet nuget push "artifacts/*.nupkg" \
83-
--source github \
84-
--api-key "${{ secrets.GITHUB_TOKEN }}" \
74+
--source https://api.nuget.org/v3/index.json \
75+
--api-key "$NUGET_ORG_API_KEY" \
8576
--skip-duplicate

0 commit comments

Comments
 (0)