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

ci: unify PR/push CI build actions #621

Merged
merged 3 commits into from
May 8, 2021
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
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:
Expand All @@ -15,6 +18,8 @@ jobs:
include:
- os: windows
target: net45
env:
LIB_PROJ: src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj
steps:
- uses: actions/checkout@v2

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
102 changes: 0 additions & 102 deletions .github/workflows/on-push.yml

This file was deleted.