Skip to content

WIP

WIP #2

name: Release
on:
push:
tags:
- '*'
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
NuGetDirectory: ${{ github.workspace}}/nuget
RINGCENTRAL_SERVER_URL: ${{ secrets.RINGCENTRAL_SERVER_URL }}
RINGCENTRAL_CLIENT_ID: ${{ secrets.RINGCENTRAL_CLIENT_ID }}
RINGCENTRAL_CLIENT_SECRET: ${{ secrets.RINGCENTRAL_CLIENT_SECRET }}
INGCENTRAL_JWT_TOKEN: ${{ secrets.RINGCENTRAL_JWT_TOKEN }}
RINGCENTRAL_SENDER: ${{ secrets.RINGCENTRAL_SENDER }}
RINGCENTRAL_RECEIVER: ${{ secrets.RINGCENTRAL_RECEIVER }}
jobs:
Create_Nuget:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Create NuGet package
run: dotnet pack --configuration Release --output ${{ env.NuGetDirectory }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: nuget
if-no-files-found: error
retention-days: 7
path: ${{ env.NuGetDirectory }}/*.nupkg
Publish_NuGet:
runs-on: macos-latest
needs: [ Create_Nuget]
steps:
# Download the NuGet package created in the previous job
- uses: actions/download-artifact@v4
with:
name: nuget
path: ${{ env.NuGetDirectory }}
# Publish all NuGet packages to NuGet.org
# Use --skip-duplicate to prevent errors if a package with the same version already exists.
# If you retry a failed workflow, already published packages will be skipped without error.
- name: Publish NuGet package
run: |
foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) {
dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
}