From 53eef903e7bb5bd9d2df2b904f4569176fd28909 Mon Sep 17 00:00:00 2001 From: David Denis Date: Thu, 2 May 2024 11:05:59 +0200 Subject: [PATCH] Reactived 'deploy' --- .github/workflows/build.yml | 56 ++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e0f21e4..59d4684 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,37 +23,37 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x - name: Restore run: dotnet restore - name: Build run: dotnet build -c Release --no-restore - # deploy: - # needs: build - # # commit contains a tag => deploy - # if: startsWith( github.ref, 'refs/tags/v' ) - # runs-on: ubuntu-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v4 - # - name: Setup .NET Core - # uses: actions/setup-dotnet@v3 - # with: - # dotnet-version: 6.0.x - # - name: Set VERSION environment variable - # run: | - # echo GitHub_ref: $GITHUB_REF - # arrTag=(${GITHUB_REF//\// }) - # VERSION="${arrTag[2]}" - # echo Version: $VERSION - # VERSION="${VERSION//v}" - # echo Clean Version: $VERSION - # echo "VERSION=${VERSION}" >> $GITHUB_ENV - # - name: Create Release NuGet package - # run: dotnet pack -v normal -c Release -p:PackageVersion=${{ env.VERSION }} -o nupkg src/Systemathics.Apis.csproj - # - name: Publish the package to nuget.org - # run: dotnet nuget push ./nupkg/Systemathics.Apis.${{ env.VERSION }}.nupkg -k $NUGET_ORG_TOKEN -s https://api.nuget.org/v3/index.json - # env: - # NUGET_ORG_TOKEN: ${{ secrets.NUGET_ORG_TOKEN }} + deploy: + needs: build + # commit contains a tag => deploy + if: startsWith( github.ref, 'refs/tags/v' ) + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup .NET Core + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + - name: Set VERSION environment variable + run: | + echo GitHub_ref: $GITHUB_REF + arrTag=(${GITHUB_REF//\// }) + VERSION="${arrTag[2]}" + echo Version: $VERSION + VERSION="${VERSION//v}" + echo Clean Version: $VERSION + echo "VERSION=${VERSION}" >> $GITHUB_ENV + - name: Create Release NuGet package + run: dotnet pack -v normal -c Release -p:PackageVersion=${{ env.VERSION }} -o nupkg src/Systemathics.Apis.csproj + - name: Publish the package to nuget.org + run: dotnet nuget push ./nupkg/Systemathics.Apis.${{ env.VERSION }}.nupkg -k $NUGET_ORG_TOKEN -s https://api.nuget.org/v3/index.json + env: + NUGET_ORG_TOKEN: ${{ secrets.NUGET_ORG_TOKEN }}