From 10c2aed3e0e9fc2b41f696a0e0522b583cee61d6 Mon Sep 17 00:00:00 2001 From: Caelan Sayler Date: Fri, 24 May 2024 11:45:36 +0100 Subject: [PATCH] Add release ci workflow --- .github/workflows/release.yml | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..34001871 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Release to NuGet.org + +on: + workflow_dispatch: + inputs: + workflow_run_id: + description: 'Workflow Run ID to publish' + required: true + default: '' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: packages + run-id: ${{ github.event.inputs.workflow_run_id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + path: ./packages + + - name: Set up NuGet + uses: nuget/setup-nuget@v2 + with: + nuget-version: 'latest' + nuget-api-key: ${{ secrets.NUGET_API_KEY }} + + - name: Publish .nupkg files + run: | + for f in packages/*.nupkg; do + dotnet nuget push "$f" + done + + - name: Publish .snupkg files + run: | + for f in packages/*.snupkg; do + dotnet nuget push "$f" + done \ No newline at end of file