Skip to content

Commit

Permalink
ci: unify PR/push CI build actions
Browse files Browse the repository at this point in the history
  • Loading branch information
piksel committed May 8, 2021
1 parent 1b9fcfc commit c8b3b9d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 111 deletions.
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 Down Expand Up @@ -64,14 +67,12 @@ jobs:

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.2.2
with:
fail_ci_if_error: false

Pack:
needs: [Build, Test]
runs-on: windows-latest
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
PKG_SUFFIX: ''

steps:
- uses: actions/checkout@v2
Expand All @@ -84,15 +85,19 @@ jobs:
dotnet-version: '3.1.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 /p:ContinuousIntegrationBuild=true src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj
- 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 /p:ContinuousIntegrationBuild=true src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj
- 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 /p:ContinuousIntegrationBuild=true src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj

- name: Add PR suffix to package
if: ${{ github.event_name == 'pull_request' }}
run: echo "PKG_SUFFIX=-PR" >> $GITHUB_ENV

- 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 src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj --configuration Release --output dist /p:ContinuousIntegrationBuild=true /p:EmbedUntrackedSources=true /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.

0 comments on commit c8b3b9d

Please sign in to comment.