From 8d979ddc6f5531f14b2407c31911f339960d2c1a Mon Sep 17 00:00:00 2001 From: Monster Date: Tue, 9 Jan 2024 21:20:01 +0300 Subject: [PATCH 1/2] nuget_publish.yml --- .github/workflows/dotnet-desktop.yml | 42 ++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/dotnet-desktop.yml diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml new file mode 100644 index 0000000..f828c8a --- /dev/null +++ b/.github/workflows/dotnet-desktop.yml @@ -0,0 +1,42 @@ +name: .NET + +on: + create: + branches: + - release/** + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup NuGet + uses: NuGet/setup-nuget@v1.0.5 + + - name: Get Build Version + run: | + Import-Module .\build\GetBuildVersion.psm1 + Write-Host $Env:GITHUB_REF + $version = GetBuildVersion -VersionString $Env:GITHUB_REF + echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append + shell: pwsh + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 7.0.x + - name: Restore dependencies + run: dotnet restore CodeCoverageExtractor/CodeCoverageExtractor.csproj + - name: Build + run: dotnet build --no-restore -p:Version=$BUILD_VERSION CodeCoverageExtractor/CodeCoverageExtractor.csproj + + - name: Publish + if: startsWith(github.ref, 'refs/heads/release') + run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_KEY}} From 651d49cde6830b4cf9c84c9b726a108df5bb3db8 Mon Sep 17 00:00:00 2001 From: Monster Date: Tue, 9 Jan 2024 21:20:38 +0300 Subject: [PATCH 2/2] =?UTF-8?q?main=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D0=B8?= =?UTF-8?q?=D0=B4=D0=BE=D1=80=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dotnet-desktop.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml index f828c8a..d089063 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/dotnet-desktop.yml @@ -5,9 +5,9 @@ on: branches: - release/** push: - branches: [ "main" ] + branches: [ "master" ] pull_request: - branches: [ "main" ] + branches: [ "master" ] jobs: build: