Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ jobs:
build:
needs: test
runs-on: macos-latest
# Setting any permission drops the rest to none, so list everything the
# job needs: id-token for NuGet trusted publishing (OIDC), packages for
# the GitHub Packages pushes, contents for checkout.
permissions:
contents: read
packages: write
id-token: write

steps:
- uses: actions/checkout@v3
Expand All @@ -33,10 +40,18 @@ jobs:
run: dotnet build TychoDB.JsonSerializer/TychoDB.JsonSerializer.csproj
- name: Create the package
run: dotnet pack --configuration Release /p:AssemblyVersion=${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }} /p:Version=${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }} TychoDB.JsonSerializer/TychoDB.JsonSerializer.csproj
# Trades the workflow's OIDC token for a short-lived (1 hour) nuget.org
# API key. Requires a matching trusted publishing policy on nuget.org.
- name: NuGet login (trusted publishing)
id: nuget-login
uses: NuGet/login@v1
with:
user: ${{ vars.NUGET_USER }}

- name: Publish the package to GPR
run: dotnet nuget push TychoDB.JsonSerializer/bin/Release/*.nupkg --api-key "${{secrets.GITHUB_TOKEN}}" --source https://nuget.pkg.github.com/theeightbot/index.json
- name: Publish the package to NuGet
run: dotnet nuget push TychoDB.JsonSerializer/bin/Release/*.nupkg --api-key "${{ secrets.EIGHTBOT_NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json
run: dotnet nuget push TychoDB.JsonSerializer/bin/Release/*.nupkg --api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json

- name: Build TychoDB.JsonSerializer.NewtonsoftJson
run: dotnet build TychoDB.JsonSerializer.NewtonsoftJson/TychoDB.JsonSerializer.NewtonsoftJson.csproj
Expand All @@ -45,7 +60,7 @@ jobs:
- name: Publish the package to GPR
run: dotnet nuget push TychoDB.JsonSerializer.NewtonsoftJson/bin/Release/*.nupkg --api-key "${{secrets.GITHUB_TOKEN}}" --source https://nuget.pkg.github.com/theeightbot/index.json
- name: Publish the package to NuGet
run: dotnet nuget push TychoDB.JsonSerializer.NewtonsoftJson/bin/Release/*.nupkg --api-key "${{ secrets.EIGHTBOT_NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json
run: dotnet nuget push TychoDB.JsonSerializer.NewtonsoftJson/bin/Release/*.nupkg --api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json

- name: Build TychoDB.JsonSerializer.SystemTextJson
run: dotnet build TychoDB.JsonSerializer.SystemTextJson/TychoDB.JsonSerializer.SystemTextJson.csproj
Expand All @@ -54,7 +69,7 @@ jobs:
- name: Publish the package to GPR
run: dotnet nuget push TychoDB.JsonSerializer.SystemTextJson/bin/Release/*.nupkg --api-key "${{secrets.GITHUB_TOKEN}}" --source https://nuget.pkg.github.com/theeightbot/index.json
- name: Publish the package to NuGet
run: dotnet nuget push TychoDB.JsonSerializer.SystemTextJson/bin/Release/*.nupkg --api-key "${{ secrets.EIGHTBOT_NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json
run: dotnet nuget push TychoDB.JsonSerializer.SystemTextJson/bin/Release/*.nupkg --api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json

- name: Build Tycho
run: dotnet build TychoDB/TychoDB.csproj
Expand All @@ -63,7 +78,7 @@ jobs:
- name: Publish the package to GPR
run: dotnet nuget push TychoDB/bin/Release/*.nupkg --api-key "${{secrets.GITHUB_TOKEN}}" --source https://nuget.pkg.github.com/theeightbot/index.json
- name: Publish the package to NuGet
run: dotnet nuget push TychoDB/bin/Release/*.nupkg --api-key "${{ secrets.EIGHTBOT_NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json
run: dotnet nuget push TychoDB/bin/Release/*.nupkg --api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json

- name: Build Tycho (Encrypted)
run: dotnet build --configuration Encrypted TychoDB/TychoDB.csproj
Expand All @@ -72,5 +87,5 @@ jobs:
- name: Publish the package to GPR (Encrypted)
run: dotnet nuget push TychoDB/bin/Encrypted/*.nupkg --api-key "${{secrets.GITHUB_TOKEN}}" --source https://nuget.pkg.github.com/theeightbot/index.json
- name: Publish the package to NuGet (Encrypted)
run: dotnet nuget push TychoDB/bin/Encrypted/*.nupkg --api-key "${{ secrets.EIGHTBOT_NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json
run: dotnet nuget push TychoDB/bin/Encrypted/*.nupkg --api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json

Loading