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
22 changes: 18 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,30 @@ on:
jobs:
publish-nuget-package:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # lets NuGet/login request a GitHub OIDC token for trusted publishing
steps:
- uses: actions/checkout@v3

- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v2.1.1

- name: Upload to Nuget
env:
NUGET_DEPLOY_KEY: ${{ secrets.NUGET_DEPLOY_KEY }}
- name: Pack
run: |
cd websocket-sharp/websocket-sharp-netstandard
dotnet pack altwebsocket-sharp.csproj -c release
dotnet nuget push bin/release/AltWebSocketSharp.1.0.10.nupkg --api-key $NUGET_DEPLOY_KEY --source https://api.nuget.org/v3/index.json

# Exchanges the OIDC token for a short-lived API key, using the trusted
# publishing policy on nuget.org. NUGET_USER is the nuget.org profile
# name (not the email) of the account that created that policy.
- name: NuGet login
uses: NuGet/login@v1
id: nuget-login
with:
user: ${{ secrets.NUGET_USER }}

- name: Upload to Nuget
run: |
cd websocket-sharp/websocket-sharp-netstandard
dotnet nuget push bin/release/AltWebSocketSharp.1.0.10.nupkg --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
Loading