Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
79 changes: 79 additions & 0 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Build master on push

on:
push:
branches: [ master ]

jobs:
BuildAndTest:
runs-on: ${{ matrix.os }}
strategy:
matrix:
configuration: ['Debug', 'Release']
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: windows-latest
libframework: net45
- os: ubuntu-latest
libframework: netstandard2
- os: macos-latest
libframework: netstandard2
steps:
- uses: actions/checkout@v2

- name: Setup .NET Core
if: matrix.libframework == 'netstandard2'
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.2.108
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 2.2.108 the appropriate version to use at this point? (I mean, I think it's one of the versions that's out of support, and I think the other PR for the nullability changes would require a v3 SDK for C#8 support)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think using the latest stable would be more appropriate


- name: Build library
run: dotnet build -c ${{ matrix.configuration }} -f ${{ matrix.libframework }} src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj

- name: Restore test dependencies
run: dotnet restore test/ICSharpCode.SharpZipLib.Tests/ICSharpCode.SharpZipLib.Tests.csproj

- name: Run tests (.NET Core)
run: dotnet test -c ${{ matrix.configuration }} -f netcoreapp2.0

- name: Run tests (.NET Framework)
if: matrix.os == 'windows'
run: dotnet test -c ${{ matrix.configuration }} -f net45


Package:
if: 1 == 2
needs: [BuildAndTest]
runs-on: windows-latest
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
# ref: v1.2.0

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.2.108
source-url: https://nuget.pkg.github.com/icsharpcode/index.json

#- name: Fix sourcelink
# run: git fetch && git checkout origin/master -- src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj assets/ICSharpCode.SharpZipLib.snk

- name: Build library for .NET Standard 2
run: dotnet build -c Release -f netstandard2 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

- name: Create nuget package
run: dotnet pack src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj --configuration Release --output dist /p:Version=$(git describe --abbrev | % { $_.substring(1) })

- name: Show package name
run: ls dist\*.nupkg

- name: Publish the package to GPR
if: false == true
run: dotnet nuget push dist\*.nupkg
104 changes: 104 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Build and Test PR

on:
pull_request:
branches: [ master ]

jobs:
Build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
configuration: ['Debug', 'Release']
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: windows-latest
libframework: net45
- os: ubuntu-latest
libframework: netstandard2
- os: macos-latest
libframework: netstandard2
steps:
- uses: actions/checkout@v2

- name: Setup .NET Core
if: matrix.libframework == 'netstandard2'
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.2.108

- name: Build library
run: dotnet build -c ${{ matrix.configuration }} -f ${{ matrix.libframework }} src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj

- name: Restore test dependencies
run: dotnet restore test/ICSharpCode.SharpZipLib.Tests/ICSharpCode.SharpZipLib.Tests.csproj

- name: Run tests (.NET Core)
run: dotnet test -c ${{ matrix.configuration }} -f netcoreapp2.0

- name: Runt tests (.NET Framework)
if: matrix.os == 'windows'
run: dotnet test -c ${{ matrix.configuration }} -f net45

Test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
configuration: ['Debug', 'Release']
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: windows-latest
libframework: net45
- os: ubuntu-latest
libframework: netstandard2
- os: macos-latest
libframework: netstandard2
steps:
- uses: actions/checkout@v2

- name: Setup .NET Core
if: matrix.libframework == 'netstandard2'
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.2.108

- name: Restore test dependencies
run: dotnet restore

- name: Run tests (.NET Core)
run: dotnet test -c ${{ matrix.configuration }} -f netcoreapp2.0

- name: Run tests (.NET Framework)
if: matrix.os == 'windows'
run: dotnet test -c ${{ matrix.configuration }} -f net45

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

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.2.108
source-url: https://nuget.pkg.github.com/icsharpcode/index.json

- name: Build library for .NET Standard 2
run: dotnet build -c Release -f netstandard2 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

- 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

- name: Upload nuget package artifact
uses: actions/upload-artifact@v2
with:
name: Nuget package
path: dist/*.nupkg
Loading