diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index 6427e2fd..c1acaaf8 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -14,4 +14,4 @@ jobs: - uses: actions/checkout@v2 - name: Run build and tests - run: ./Build.ps1 -RunTests $true + run: ./Build.ps1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8c24a444..d4dd0f6b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v2 - name: Run build - run: ./Build.ps1 + run: ./Build.ps1 -SkipTests $true - name: Read version from csproj run: | @@ -24,15 +24,15 @@ jobs: echo "Found version $versionMatch" - name: Create GitHub releease - # if: ${{ github.ref_name == 'master' }} + if: ${{ github.ref_name == 'master' }} uses: "marvinpinto/action-automatic-releases@latest" with: repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "v${{ env.VERSION }}-test" - draft: true - title: "v${{ env.VERSION }}-test" + automatic_release_tag: "v${{ env.VERSION }}" + title: "v${{ env.VERSION }}" files: | artifacts/*.nupkg artifacts/*.snupkg - # TODO: upload to nuget.org + - name: Publish to nuget.org + run: nuget push artifacts\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}} diff --git a/Build.ps1 b/Build.ps1 index 1886ff10..64e8b749 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -2,7 +2,7 @@ param ( [Parameter(Mandatory = $false)] [System.Boolean] - $RunTests = $false + $SkipTests = $false ) echo "build: Build started" @@ -18,7 +18,7 @@ if(Test-Path .\artifacts) { $branch = @{ $true = $env:GITHUB_REF_NAME; $false = $(git symbolic-ref --short -q HEAD) }[$env:GITHUB_REF_NAME -ne $NULL]; $revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:GITHUB_RUN_NUMBER, 10); $false = "local" }[$env:GITHUB_RUN_NUMBER -ne $NULL]; -$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"] +$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -ne "dev" -and $revision -ne "local"] echo "build: Version suffix is $suffix" @@ -37,7 +37,7 @@ foreach ($src in ls src/*) { Pop-Location } -if ($RunTests -eq $true) { +if ($SkipTests -eq $false) { foreach ($test in ls test/*.PerformanceTests) { Push-Location $test