From dff43a3bad9fb995c80741528a33706206e4c597 Mon Sep 17 00:00:00 2001 From: Fabio Gaming Date: Tue, 16 Apr 2024 23:13:51 +0200 Subject: [PATCH] Create dev-autopublish --- .github/workflows/dev-autopublish | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/dev-autopublish diff --git a/.github/workflows/dev-autopublish b/.github/workflows/dev-autopublish new file mode 100644 index 0000000..42335be --- /dev/null +++ b/.github/workflows/dev-autopublish @@ -0,0 +1,35 @@ +name: Publish NuGet Package + +on: + push: + branches: + - dev + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '7.x' # or the version you are using + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release + + - name: Determine version + id: version + run: echo "::set-output name=version::0.$((${GITHUB_RUN_NUMBER} / 100)).$((${GITHUB_RUN_NUMBER} % 100))" + + - name: Pack + run: dotnet pack --configuration Release --version-suffix "-dev${{ steps.version.outputs.version }}" --output nupkgs + + - name: Publish to NuGet + run: dotnet nuget push nupkgs/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json