-
Notifications
You must be signed in to change notification settings - Fork 976
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR #621: unify PR/push CI build actions
* ci: unify PR/push CI build actions * ci: build packages using .net 5 for healthy nupkgs * ci: simplify action syntax, use correct build flags
- Loading branch information
Showing
2 changed files
with
21 additions
and
114 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 |
---|---|---|
@@ -1,8 +1,11 @@ | ||
name: Build and Test PR | ||
name: Build and Test | ||
|
||
on: | ||
pull_request: | ||
branches: [ master ] | ||
push: | ||
branches: [ master ] | ||
release: | ||
|
||
jobs: | ||
Build: | ||
|
@@ -15,6 +18,8 @@ jobs: | |
include: | ||
- os: windows | ||
target: net45 | ||
env: | ||
LIB_PROJ: src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
|
@@ -24,10 +29,10 @@ jobs: | |
dotnet-version: '3.1.x' | ||
|
||
- name: Build library (Debug) | ||
run: dotnet build -c debug -f ${{ matrix.target }} src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj | ||
run: dotnet build -c debug -f ${{ matrix.target }} ${{ env.LIB_PROJ }} | ||
|
||
- name: Build library (Release) | ||
run: dotnet build -c release -f ${{ matrix.target }} src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj | ||
run: dotnet build -c release -f ${{ matrix.target }} ${{ env.LIB_PROJ }} | ||
|
||
Test: | ||
runs-on: ${{ matrix.os }}-latest | ||
|
@@ -64,14 +69,14 @@ jobs: | |
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
fail_ci_if_error: false | ||
|
||
Pack: | ||
needs: [Build, Test] | ||
runs-on: windows-latest | ||
env: | ||
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
PKG_SUFFIX: '' | ||
PKG_PROJ: src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj | ||
PKG_PROPS: '/p:ContinuousIntegrationBuild=true /p:EmbedUntrackedSources=true' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -81,18 +86,22 @@ jobs: | |
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '3.1.x' | ||
dotnet-version: '5.0.x' | ||
|
||
- name: Build library for .NET Standard 2.0 | ||
run: dotnet build -c Release -f netstandard2.0 src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj | ||
run: dotnet build -c Release -f netstandard2.0 ${{ env.PKG_PROPS }} ${{ env.PKG_PROJ }} | ||
- name: Build library for .NET Standard 2.1 | ||
run: dotnet build -c Release -f netstandard2.1 src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj | ||
run: dotnet build -c Release -f netstandard2.1 ${{ env.PKG_PROPS }} ${{ env.PKG_PROJ }} | ||
- name: Build library for .NET Framework 4.5 | ||
run: dotnet build -c Release -f net45 src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj | ||
run: dotnet build -c Release -f net45 ${{ env.PKG_PROPS }} ${{ env.PKG_PROJ }} | ||
|
||
- name: Add PR suffix to package | ||
if: ${{ github.event_name == 'pull_request' }} | ||
run: echo "PKG_SUFFIX=-PR" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
|
||
- name: Create nuget package | ||
run: dotnet pack src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj --configuration Release --output dist /p:Version=$(git describe --abbrev | % { $_.substring(1) })-PR | ||
run: dotnet pack ${{ env.PKG_PROJ }} -c Release --output dist ${{ env.PKG_PROPS }} /p:Version=$(git describe --abbrev | % { $_.substring(1) })${{ env.PKG_SUFFIX }} | ||
|
||
- name: Upload nuget package artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
|
This file was deleted.
Oops, something went wrong.