-
-
Notifications
You must be signed in to change notification settings - Fork 852
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable using github actions for building
+ publish to github package repository
- Loading branch information
Showing
10 changed files
with
238 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
Coverage: | ||
runs-on: windows-latest | ||
needs: [Build] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Enable long file paths | ||
run: git config --global core.longpaths true | ||
|
||
- name: Update submodules | ||
run: git submodule -q update --init | ||
|
||
- name: Generate Test Coverage | ||
shell: pwsh | ||
run: ./tests/CodeCoverage/CodeCoverage.ps1 | ||
env: | ||
CI : True | ||
|
||
- name: Update codecov | ||
uses: iansu/codecov-action-node@v1.0.0 | ||
with: | ||
token: ${{secrets.CODECOV_TOKEN}} | ||
file: "ImageSharp.Coverage.xml" | ||
flags: unittests | ||
|
||
Build: | ||
strategy: | ||
matrix: | ||
options: | ||
- os : ubuntu-latest | ||
framework: netcoreapp2.1 | ||
is32Bit: False | ||
- os : windows-latest | ||
framework: netcoreapp2.1 | ||
is32Bit: False | ||
- os : windows-latest | ||
framework: net472 | ||
is32Bit: False | ||
- os : windows-latest | ||
framework: net472 | ||
is32Bit: True | ||
|
||
runs-on: ${{ matrix.options.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Enable long file paths | ||
run: | | ||
git config --global core.autocrlf false | ||
git config --global core.longpaths true | ||
- name: Update submodules | ||
run: git submodule -q update --init | ||
|
||
- name: Build | ||
shell: pwsh | ||
run: | | ||
$DebugPreference = "Continue" | ||
./build.ps1 "${{matrix.options.framework}}" | ||
- name: Test | ||
shell: pwsh | ||
run: ./run-tests.ps1 "${{matrix.options.framework}}" "${{matrix.options.is32Bit}}" true | ||
env: | ||
CI : True | ||
|
||
Publish: | ||
runs-on: windows-latest | ||
needs: [Build] | ||
if : github.event_name == 'push' | ||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Enable long file paths | ||
run: git config --global core.longpaths true | ||
|
||
- name: Update submodules | ||
run: git submodule -q update --init | ||
|
||
- name: Build | ||
shell: pwsh | ||
run: | | ||
$DebugPreference = "Continue" | ||
./build.ps1 | ||
- name : install nuget | ||
if: success() | ||
uses: warrenbuckley/Setup-Nuget@v1 | ||
|
||
- name: Configure feed | ||
if: success() | ||
run: nuget.exe source Add -Name "GitHub" -Source "https://nuget.pkg.github.com/sixlabors/index.json" -UserName ${{github.actor}} -Password ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish to nightly feed - github | ||
if: success() | ||
run: nuget.exe push -Source "GitHub" .\artifacts\*.nupkg | ||
|
||
- name: Publish to nightly feed -myget | ||
if: success() | ||
run: nuget.exe push .\artifacts\*.nupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v2/package | ||
|
||
# todo if github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
if((Test-Path("$PSScriptRoot\OpenCover.4.6.519")) -eq $false){ | ||
Invoke-WebRequest https://www.nuget.org/api/v2/package/OpenCover/4.7.922 -OutFile "$PSScriptRoot\opencover.zip" | ||
[IO.Compression.Zipfile]::ExtractToDirectory("$PSScriptRoot\opencover.zip","$PSScriptRoot\OpenCover.4.6.519") | ||
} | ||
|
||
dotnet clean ImageSharp.sln -c Release | ||
|
||
& "$PSScriptRoot\OpenCover.4.6.519\tools\OpenCover.Console.exe" -target:"dotnet.exe" -targetargs:"test tests\ImageSharp.Tests\ImageSharp.Tests.csproj -c Release -f netcoreapp2.1 /p:skipFullFramework=true /p:codecov=true" -register:user -threshold:10 -oldStyle -safemode:off -output:.\ImageSharp.Coverage.xml -hideskipped:All -returntargetcode -filter:"+[SixLabors.ImageSharp*]*" | ||
|
||
if ($LASTEXITCODE ){ Exit $LASTEXITCODE } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters