Skip to content

Commit 39ee24b

Browse files
committed
Changes.
1 parent 1a21518 commit 39ee24b

35 files changed

Lines changed: 547 additions & 591 deletions

.github/workflows/dotnet-publish.yml

Lines changed: 74 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,95 @@ on:
99
- '*'
1010

1111
jobs:
12-
build:
12+
build-native:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
os: [windows-latest, ubuntu-latest, macos-latest]
16+
os: [windows-11-arm, ubuntu-latest, macos-latest]
1717
runs-on: ${{ matrix.os }}
1818
env:
1919
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
2020
DOTNET_CLI_TELEMETRY_OPTOUT: true
2121
DOTNET_NOLOGO: true
22-
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
2322
steps:
2423
- uses: actions/checkout@main
24+
25+
- name: Install latest .NET SDK
26+
uses: Elskom/setup-latest-dotnet@main
27+
with:
28+
SDK_VERSION: '10.0.100'
29+
RUNTIME_VERSIONS: '8.0.x'
30+
31+
- name: Clone madler/zlib for ZlibSharp.Native.
32+
run: |
33+
cd src/ZlibSharp.Native
34+
git clone https://github.com/madler/zlib.git
35+
cd ../..
36+
shell: pwsh
37+
38+
- name: Set up Visual Studio Dev shell
39+
if: runner.OS == 'Windows'
40+
uses: egor-tensin/vs-shell@master
41+
with:
42+
arch: x64
43+
44+
- name: build native library (win-x86, win-x64, win-arm, win-arm64)
45+
if: runner.OS == 'Windows'
46+
run: |
47+
cd src/ZlibSharp.Native
48+
./build-windows.ps1
49+
cd ../..
50+
shell: pwsh
51+
52+
- name: build native library (linux-x86, linux-x64, linux-arm, linux-arm64)
53+
if: runner.OS == 'Linux'
54+
run: |
55+
cd src/ZlibSharp.Native
56+
chmod +x ./build-linux.sh
57+
./build-linux.sh
58+
cd ../..
59+
shell: pwsh
60+
61+
- name: build native library (osx-x64, osx-arm64)
62+
if: runner.OS == 'MacOS'
63+
run: |
64+
cd src/ZlibSharp.Native
65+
chmod +x ./build-osx.sh
66+
./build-osx.sh
67+
cd ../..
68+
shell: pwsh
69+
70+
- name: Upload artifacts
71+
uses: actions/upload-artifact@main
72+
with:
73+
name: artifacts-${{ runner.os }}
74+
path: artifacts/*
75+
76+
build:
77+
needs: build-native
78+
runs-on: ubuntu-latest
79+
permissions:
80+
contents: write
81+
env:
82+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
83+
DOTNET_CLI_TELEMETRY_OPTOUT: true
84+
DOTNET_NOLOGO: true
85+
steps:
86+
- uses: actions/checkout@main
87+
2588
- name: Install latest .NET SDK
2689
uses: Elskom/setup-latest-dotnet@main
2790
with:
28-
SDK_VERSION: '9.0.100'
91+
SDK_VERSION: '10.0.100'
2992
RUNTIME_VERSIONS: '8.0.x'
3093

94+
- name: Download artifacts
95+
uses: actions/download-artifact@main
96+
with:
97+
pattern: artifacts-*
98+
path: artifacts/
99+
merge-multiple: true
100+
31101
- name: Restore, Build, Test, Pack, and Push.
32102
uses: Elskom/build-dotnet@main
33103
with:

.github/workflows/dotnet.yml

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,95 @@ on:
1010
branches: [ "main" ]
1111

1212
jobs:
13-
build:
13+
build-native:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
os: [windows-latest, ubuntu-latest, macos-latest]
17+
os: [windows-11-arm, ubuntu-latest, macos-latest]
1818
runs-on: ${{ matrix.os }}
1919
env:
2020
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
2121
DOTNET_CLI_TELEMETRY_OPTOUT: true
2222
DOTNET_NOLOGO: true
2323
steps:
2424
- uses: actions/checkout@main
25+
2526
- name: Install latest .NET SDK
2627
uses: Elskom/setup-latest-dotnet@main
2728
with:
28-
SDK_VERSION: '9.0.100'
29+
SDK_VERSION: '10.0.100'
2930
RUNTIME_VERSIONS: '8.0.x'
3031

32+
- name: Clone madler/zlib for ZlibSharp.Native.
33+
run: |
34+
cd src/ZlibSharp.Native
35+
git clone https://github.com/madler/zlib.git
36+
cd ../..
37+
shell: pwsh
38+
39+
- name: Set up Visual Studio Dev shell
40+
if: runner.OS == 'Windows'
41+
uses: egor-tensin/vs-shell@master
42+
with:
43+
arch: x64
44+
45+
- name: build native library (win-x86, win-x64, win-arm, win-arm64)
46+
if: runner.OS == 'Windows'
47+
run: |
48+
cd src/ZlibSharp.Native
49+
./build-windows.ps1
50+
cd ../..
51+
shell: pwsh
52+
53+
- name: build native library (linux-x86, linux-x64, linux-arm, linux-arm64)
54+
if: runner.OS == 'Linux'
55+
run: |
56+
cd src/ZlibSharp.Native
57+
chmod +x ./build-linux.sh
58+
./build-linux.sh
59+
cd ../..
60+
shell: pwsh
61+
62+
- name: build native library (osx-x64, osx-arm64)
63+
if: runner.OS == 'MacOS'
64+
run: |
65+
cd src/ZlibSharp.Native
66+
chmod +x ./build-osx.sh
67+
./build-osx.sh
68+
cd ../..
69+
shell: pwsh
70+
71+
- name: Upload artifacts
72+
uses: actions/upload-artifact@main
73+
with:
74+
name: artifacts-${{ runner.os }}
75+
path: artifacts/*
76+
77+
build:
78+
needs: build-native
79+
runs-on: ubuntu-latest
80+
permissions:
81+
contents: write
82+
env:
83+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
84+
DOTNET_CLI_TELEMETRY_OPTOUT: true
85+
DOTNET_NOLOGO: true
86+
steps:
87+
- uses: actions/checkout@main
88+
89+
- name: Install latest .NET SDK
90+
uses: Elskom/setup-latest-dotnet@main
91+
with:
92+
SDK_VERSION: '10.0.100'
93+
RUNTIME_VERSIONS: '8.0.x'
94+
95+
- name: Download artifacts
96+
uses: actions/download-artifact@main
97+
with:
98+
pattern: artifacts-*
99+
path: artifacts/
100+
merge-multiple: true
101+
31102
- name: Restore, Build, Test, and Pack.
32103
uses: Elskom/build-dotnet@main
33104
with:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,3 +455,6 @@ $RECYCLE.BIN/
455455

456456
# Native runtimes build outputs folder.
457457
runtimes/
458+
459+
# zlib clone for building ZlibSharp.Native.
460+
zlib/

Directory.Build.props

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
<Project>
22

33
<PropertyGroup>
4-
<TargetFramework Condition="'$(MSBuildProjectName)' != 'ZlibSharp.IO.Hashing'">net10.0</TargetFramework>
5-
<TargetFrameworks Condition="'$(MSBuildProjectName)' == 'ZlibSharp.IO.Hashing'">netstandard2.0;net8.0;net9.0;net10.0</TargetFrameworks>
4+
<TargetFramework Condition="'$(MSBuildProjectName)' != 'ZlibSharp.IO.Hashing' AND '$(MSBuildProjectName)' != 'ZlibSharp'">net10.0</TargetFramework>
5+
<TargetFrameworks Condition="'$(MSBuildProjectName)' == 'ZlibSharp.IO.Hashing' OR '$(MSBuildProjectName)' == 'ZlibSharp'">netstandard2.0;net8.0;net9.0;net10.0</TargetFrameworks>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<DebugType>embedded</DebugType>
99
<SignAssembly>True</SignAssembly>
1010
<LangVersion>latest</LangVersion>
1111
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)Elskom.snk</AssemblyOriginatorKeyFile>
12+
<PackageOutputPath>$(MSBuildThisFileDirectory)artifacts</PackageOutputPath>
13+
<RestoreAdditionalProjectSources>$(PackageOutputPath)</RestoreAdditionalProjectSources>
14+
<!--
15+
First we must set this to RestoreSources so the existing values are not lost.
16+
17+
Second, why the fuck is nuget.org not a part of this property by default???
18+
-->
19+
<RestoreSources>
20+
$(RestoreSources);
21+
https://api.nuget.org/v3/index.json;
22+
$(RestoreAdditionalProjectSources)
23+
</RestoreSources>
1224
</PropertyGroup>
1325

1426
</Project>

ZlibSharp.sln

Lines changed: 0 additions & 100 deletions
This file was deleted.

ZlibSharp.slnx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Solution>
2+
<Configurations>
3+
<Platform Name="Any CPU" />
4+
</Configurations>
5+
<Folder Name="/src/">
6+
<Project Path="src/ZlibSharp.IO.Hashing/ZlibSharp.IO.Hashing.csproj" />
7+
<Project Path="src/ZlibSharp/ZlibSharp.csproj" />
8+
<Project Path="src/ZlibSharp.Native/ZlibSharp.Native.csproj" />
9+
</Folder>
10+
<Folder Name="/tests/">
11+
<Project Path="tests/ZlibSharp.Tests.csproj" />
12+
</Folder>
13+
</Solution>

src/ZlibSharp.Exceptions/Directory.Build.props

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/ZlibSharp.Exceptions/Directory.Build.targets

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/ZlibSharp.Exceptions/ZlibSharp.Exceptions.csproj

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)