diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index bcf4f2a..1313d25 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -11,11 +11,13 @@ on: description: 'Package version' required: true +defaults: + run: + shell: pwsh + jobs: build: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 @@ -43,4 +45,23 @@ jobs: uses: actions/upload-artifact@v4.6.2 with: name: uDiscussions-${{ github.event.inputs.package_version }} - path: ${{ env.OUTPUT }}/**/* \ No newline at end of file + path: ${{ env.OUTPUT }}/**/* + release: + runs-on: ubuntu-latest + needs: [ build ] + steps: + - uses: actions/download-artifact@v4.2.1 + with: + name: uDiscussions-${{ github.event.inputs.package_version }} + path: ${{ env.OUTPUT }} + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 9.0.x + + - name: Publish NuGet packages + run: | + foreach($file in (Get-ChildItem "${{ env.OUTPUT }}" -Recurse -Include *.nupkg)) { + dotnet nuget push $file --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate + } \ No newline at end of file