From aa7426dfa267d89c5d117db3c4c80a2e4f7acd57 Mon Sep 17 00:00:00 2001 From: zznty <94796179+zznty@users.noreply.github.com> Date: Sat, 9 Nov 2024 19:33:43 +0700 Subject: [PATCH] push to new nuget --- .github/workflows/release.yaml | 39 +++++++++++----------------------- global.json | 7 ++++++ 2 files changed, 19 insertions(+), 27 deletions(-) create mode 100644 global.json diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1431580..2e2d821 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -5,7 +5,6 @@ on: branches: [master] env: - BUILD_CONFIGURATION: Release DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true @@ -33,36 +32,24 @@ jobs: name: Build and Publish Nuget runs-on: ubuntu-latest needs: [get-version] + strategy: + matrix: + project: [ Torch.API, Torch, Torch.Server ] steps: - uses: actions/checkout@master name: Checkout - - uses: actions/setup-dotnet@v3 + - uses: actions/setup-dotnet@v4 name: Setup dotnet - with: - dotnet-version: '8.0.x' - name: Restore dependencies - run: dotnet restore Torch.Server/Torch.Server.csproj --locked-mode + run: dotnet restore ${{ matrix.project }}/${{ matrix.project }}.csproj --locked-mode - - name: Build - run: dotnet build Torch.Server/Torch.Server.csproj --no-restore -c ${{ env.BUILD_CONFIGURATION }} -p:Version="${{ needs.get-version.outputs.version }}" -p:AssemblyVersion="${{ needs.get-version.outputs.version }}" - - - run: dotnet pack -c Release ./Torch.API/Torch.API.csproj -o pack -p:Version="${{ needs.get-version.outputs.version }}" -p:AssemblyVersion="${{ needs.get-version.outputs.version }}" --no-build - - run: dotnet pack -c Release ./Torch/Torch.csproj -o pack -p:Version="${{ needs.get-version.outputs.version }}" -p:AssemblyVersion="${{ needs.get-version.outputs.version }}" --no-build - - run: dotnet pack -c Release ./Torch.Server/Torch.Server.csproj -o pack -p:Version="${{ needs.get-version.outputs.version }}" -p:AssemblyVersion="${{ needs.get-version.outputs.version }}" --no-build - - - name: Install Sleet - run: dotnet tool install -g sleet --version 5.1.3 - - name: Push Nuget Package - env: - SLEET_FEED_TYPE: s3 - SLEET_FEED_PATH: https://nuget.storage.yandexcloud.net - SLEET_FEED_BUCKETNAME: nuget - SLEET_FEED_SERVICEURL: https://storage.yandexcloud.net - SLEET_FEED_ACCESSKEYID: ${{ secrets.S3_KEY_ID }} - SLEET_FEED_SECRETACCESSKEY: ${{ secrets.S3_KEY }} - run: /root/.dotnet/tools/sleet push ./pack + - name: Pack + run: dotnet pack ${{ matrix.project }}/${{ matrix.project }}.csproj -o pack --no-restore -p:Version="${{ needs.get-version.outputs.version }}" -p:AssemblyVersion="${{ needs.get-version.outputs.version }}" + + - name: Push + run: dotnet nuget push -s https://ng.zznty.ru/v3/index.json -k ${{ secrets.NUGET_API_KEY }} ./pack/${{ matrix.project }}.${{ needs.get-version.outputs.version }}.nupkg build: name: Build and Publish Package @@ -72,16 +59,14 @@ jobs: - uses: actions/checkout@master name: Checkout - - uses: actions/setup-dotnet@v3 + - uses: actions/setup-dotnet@v4 name: Setup dotnet - with: - dotnet-version: '8.0.x' - name: Restore dependencies run: dotnet restore Torch.Server/Torch.Server.csproj --locked-mode -r win-x64 - name: Publish - run: dotnet publish Torch.Server/Torch.Server.csproj --no-restore --sc -r win-x64 -c ${{ env.BUILD_CONFIGURATION }} -o ./publish -p:Version="${{ needs.get-version.outputs.version }}" -p:AssemblyVersion="${{ needs.get-version.outputs.version }}" + run: dotnet publish Torch.Server/Torch.Server.csproj --no-restore --sc -r win-x64 -o ./publish -p:Version="${{ needs.get-version.outputs.version }}" -p:AssemblyVersion="${{ needs.get-version.outputs.version }}" - uses: vimtor/action-zip@v1 name: Zip Release diff --git a/global.json b/global.json new file mode 100644 index 0000000..1df2109 --- /dev/null +++ b/global.json @@ -0,0 +1,7 @@ +{ + "sdk": { + "version": "8.0.0", + "rollForward": "latestFeature", + "allowPrerelease": false + } +} \ No newline at end of file