Skip to content

Commit 8c7d128

Browse files
committed
Changes.
1 parent 1a21518 commit 8c7d128

32 files changed

Lines changed: 806 additions & 753 deletions

.github/workflows/dotnet-publish.yml

Lines changed: 103 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,124 @@ 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 x86 shell
39+
if: runner.OS == 'Windows'
40+
uses: egor-tensin/vs-shell@master
41+
with:
42+
arch: x86
43+
44+
- name: CMake configure and build native library (win-x86)
45+
if: runner.OS == 'Windows'
46+
run: |
47+
cd src/ZlibSharp.Native
48+
cmake --workflow --preset win-x86
49+
cd ../..
50+
shell: pwsh
51+
52+
- name: Set up Visual Studio x64 shell
53+
if: runner.OS == 'Windows'
54+
uses: egor-tensin/vs-shell@master
55+
with:
56+
arch: x64
57+
58+
- name: CMake configure and build native library (win-x64)
59+
if: runner.OS == 'Windows'
60+
run: |
61+
cd src/ZlibSharp.Native
62+
cmake --workflow --preset win-x64
63+
cd ../..
64+
shell: pwsh
65+
66+
- name: Set up Visual Studio ARM64 shell
67+
if: runner.OS == 'Windows'
68+
uses: egor-tensin/vs-shell@master
69+
with:
70+
arch: ARM64
71+
72+
- name: CMake configure and build native library (win-arm64)
73+
if: runner.OS == 'Windows'
74+
run: |
75+
cd src/ZlibSharp.Native
76+
cmake --workflow --preset win-arm64
77+
dotnet pack -c Release
78+
cd ../..
79+
shell: pwsh
80+
81+
- name: CMake configure and build native library (linux-x86, linux-x64, linux-arm64)
82+
if: runner.OS == 'Linux'
83+
run: |
84+
cd src/ZlibSharp.Native
85+
chmod +x ./build-linux.sh
86+
./build-linux.sh
87+
cd ../..
88+
shell: pwsh
89+
90+
- name: CMake configure and build native library (osx-x64, osx-arm64)
91+
if: runner.OS == 'MacOS'
92+
run: |
93+
cd src/ZlibSharp.Native
94+
chmod +x ./build-osx.sh
95+
./build-osx.sh
96+
cd ../..
97+
shell: pwsh
98+
99+
- name: Upload artifacts
100+
uses: actions/upload-artifact@main
101+
with:
102+
name: artifacts-${{ runner.os }}
103+
path: artifacts/*
104+
105+
build:
106+
needs: build-native
107+
runs-on: ubuntu-latest
108+
permissions:
109+
contents: write
110+
env:
111+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
112+
DOTNET_CLI_TELEMETRY_OPTOUT: true
113+
DOTNET_NOLOGO: true
114+
steps:
115+
- uses: actions/checkout@main
116+
25117
- name: Install latest .NET SDK
26118
uses: Elskom/setup-latest-dotnet@main
27119
with:
28-
SDK_VERSION: '9.0.100'
120+
SDK_VERSION: '10.0.100'
29121
RUNTIME_VERSIONS: '8.0.x'
30122

123+
- name: Download artifacts
124+
uses: actions/download-artifact@main
125+
with:
126+
pattern: artifacts-*
127+
path: artifacts/
128+
merge-multiple: true
129+
31130
- name: Restore, Build, Test, Pack, and Push.
32131
uses: Elskom/build-dotnet@main
33132
with:

.github/workflows/dotnet.yml

Lines changed: 103 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,124 @@ 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 x86 shell
40+
if: runner.OS == 'Windows'
41+
uses: egor-tensin/vs-shell@master
42+
with:
43+
arch: x86
44+
45+
- name: CMake configure and build native library (win-x86)
46+
if: runner.OS == 'Windows'
47+
run: |
48+
cd src/ZlibSharp.Native
49+
cmake --workflow --preset win-x86
50+
cd ../..
51+
shell: pwsh
52+
53+
- name: Set up Visual Studio x64 shell
54+
if: runner.OS == 'Windows'
55+
uses: egor-tensin/vs-shell@master
56+
with:
57+
arch: x64
58+
59+
- name: CMake configure and build native library (win-x64)
60+
if: runner.OS == 'Windows'
61+
run: |
62+
cd src/ZlibSharp.Native
63+
cmake --workflow --preset win-x64
64+
cd ../..
65+
shell: pwsh
66+
67+
- name: Set up Visual Studio ARM64 shell
68+
if: runner.OS == 'Windows'
69+
uses: egor-tensin/vs-shell@master
70+
with:
71+
arch: ARM64
72+
73+
- name: CMake configure and build native library (win-arm64)
74+
if: runner.OS == 'Windows'
75+
run: |
76+
cd src/ZlibSharp.Native
77+
cmake --workflow --preset win-arm64
78+
dotnet pack -c Release
79+
cd ../..
80+
shell: pwsh
81+
82+
- name: CMake configure and build native library (linux-x86, linux-x64, linux-arm64)
83+
if: runner.OS == 'Linux'
84+
run: |
85+
cd src/ZlibSharp.Native
86+
chmod +x ./build-linux.sh
87+
./build-linux.sh
88+
cd ../..
89+
shell: pwsh
90+
91+
- name: CMake configure and build native library (osx-x64, osx-arm64)
92+
if: runner.OS == 'MacOS'
93+
run: |
94+
cd src/ZlibSharp.Native
95+
chmod +x ./build-osx.sh
96+
./build-osx.sh
97+
cd ../..
98+
shell: pwsh
99+
100+
- name: Upload artifacts
101+
uses: actions/upload-artifact@main
102+
with:
103+
name: artifacts-${{ runner.os }}
104+
path: artifacts/*
105+
106+
build:
107+
needs: build-native
108+
runs-on: ubuntu-latest
109+
permissions:
110+
contents: write
111+
env:
112+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
113+
DOTNET_CLI_TELEMETRY_OPTOUT: true
114+
DOTNET_NOLOGO: true
115+
steps:
116+
- uses: actions/checkout@main
117+
118+
- name: Install latest .NET SDK
119+
uses: Elskom/setup-latest-dotnet@main
120+
with:
121+
SDK_VERSION: '10.0.100'
122+
RUNTIME_VERSIONS: '8.0.x'
123+
124+
- name: Download artifacts
125+
uses: actions/download-artifact@main
126+
with:
127+
pattern: artifacts-*
128+
path: artifacts/
129+
merge-multiple: true
130+
31131
- name: Restore, Build, Test, and Pack.
32132
uses: Elskom/build-dotnet@main
33133
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.

0 commit comments

Comments
 (0)