From ca81dfee918d9d853311d19e9c9dedcf82ed299a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20H=C3=BCbner?= Date: Sun, 6 Aug 2023 17:15:18 +0200 Subject: [PATCH] ci: add release build --- .github/workflows/release.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 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 0000000..04d9a5a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: Publish nuget package + +on: + push: + tags: v* + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Get version from tag + id: get_version + # "refs/tags/v" is 11 characters + run: | + versionNumber=${GITHUB_REF:11} + echo "::set-output name=version_number::$versionNumber" + + - uses: actions/checkout@v3 + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + + - name: Create nuget package + run: dotnet pack -c Release package -o _out -p:Version=${{ steps.get_version.outputs.version_number }} + + - name: Push nuget package to nuget.org + run: dotnet nuget push _out/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json