Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub actions #388

Merged
merged 21 commits into from
Feb 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
- uses: actions/checkout@v2

- name: Run build and tests
run: ./Build.ps1 -RunTests $true
run: ./Build.ps1
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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}}
6 changes: 3 additions & 3 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
param (
[Parameter(Mandatory = $false)]
[System.Boolean]
$RunTests = $false
$SkipTests = $false
)

echo "build: Build started"
Expand All @@ -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"

Expand All @@ -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

Expand Down