Skip to content

Commit 3d6f04c

Browse files
committed
Refactor GitHub Actions workflow for zlib build and update process
1 parent d89fbcd commit 3d6f04c

File tree

3 files changed

+121
-86
lines changed

3 files changed

+121
-86
lines changed

.github/workflows/cmake-old.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Build zlib Libraries
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
include:
11+
- os: ubuntu-latest
12+
arch: x86_64
13+
cmake-arch: x64
14+
- os: linux
15+
arch: arm64
16+
cmake-arch: aarch64
17+
runner-label: self-hosted
18+
- os: windows-latest
19+
arch: x86_64
20+
triplet: x64-windows
21+
cmake-arch: x64
22+
- os: windows-latest
23+
arch: x86
24+
triplet: x86-windows
25+
cmake-arch: win32
26+
- os: windows-latest
27+
arch: arm64
28+
triplet: arm64-windows
29+
cmake-arch: arm64
30+
- os: macos-latest
31+
arch: x86_64
32+
cmake-arch: x86_64
33+
- os: macos-latest
34+
arch: arm64
35+
cmake-arch: arm64
36+
37+
steps:
38+
- uses: actions/checkout@v4.1.7
39+
with:
40+
repository: "madler/zlib"
41+
path: "zlib"
42+
ref: "v1.3.1"
43+
submodules: true
44+
45+
- name: Install Dependencies on Ubuntu
46+
if: matrix.os == 'linux' || matrix.os == 'ubuntu-latest'
47+
run: |
48+
sudo apt-get update
49+
sudo apt-get install -y build-essential cmake
50+
51+
- name: Configure zlib with CMake on Linux
52+
if: matrix.os == 'linux' || matrix.os == 'ubuntu-latest'
53+
run: |
54+
cd zlib
55+
cmake -S ./ -B ./build -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.cmake-arch }} -DZLIB_BUILD_TESTING=OFF -DZLIB_BUILD_SHARED=ON -DZLIB_BUILD_STATIC=OFF
56+
57+
- name: Configure zlib with CMake on Windows
58+
if: matrix.os == 'windows-latest' && matrix.arch != 'arm64'
59+
run: |
60+
cd zlib
61+
cmake -S ./ -B ./build -DCMAKE_BUILD_TYPE=Release -A ${{ matrix.cmake-arch }} -DZLIB_BUILD_TESTING=OFF -DZLIB_BUILD_SHARED=ON -DZLIB_BUILD_STATIC=OFF
62+
63+
- name: Configure zlib with CMake on Windows (ARM64)
64+
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64'
65+
run: |
66+
cd zlib
67+
cmake -S ./ -B ./build -DCMAKE_BUILD_TYPE=Release -A ${{ matrix.cmake-arch }} -DZLIB_BUILD_TESTING=OFF -DZLIB_BUILD_SHARED=ON -DZLIB_BUILD_STATIC=OFF -DCMAKE_SYSTEM_VERSION=10.0.26100.0
68+
69+
- name: Configure zlib with CMake on macOS
70+
if: matrix.os == 'macos-latest'
71+
run: |
72+
cd zlib
73+
cmake -S ./ -B ./build -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=${{ matrix.cmake-arch }} -DZLIB_BUILD_TESTING=OFF -DZLIB_BUILD_SHARED=ON -DZLIB_BUILD_STATIC=OFF
74+
75+
- name: Build zlib
76+
run: cmake --build zlib/build --config Release
77+
78+
- name: Move Windows binaries
79+
if: matrix.os == 'windows-latest'
80+
run: |
81+
mv zlib/build/Release/*.dll zlib/build/
82+
83+
- name: Upload Artifacts
84+
uses: actions/upload-artifact@v4.3.4
85+
with:
86+
name: zlib-${{ matrix.os }}-${{ matrix.arch }}-artifacts
87+
path: |
88+
zlib/build/*.dll
89+
zlib/build/*.so
90+
zlib/build/*.dylib
91+
if-no-files-found: ignore # 'warn' or 'ignore' or 'error'

.github/workflows/cmake.yml

Lines changed: 27 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,32 @@
1-
name: Build zlib Libraries
1+
name: Build and Update zlib Libraries
22

33
on: [workflow_dispatch]
44

55
jobs:
66
build:
7-
runs-on: ${{ matrix.os }}
8-
strategy:
9-
matrix:
10-
include:
11-
- os: ubuntu-latest
12-
arch: x86_64
13-
cmake-arch: x64
14-
- os: linux
15-
arch: arm64
16-
cmake-arch: aarch64
17-
runner-label: self-hosted
18-
- os: windows-latest
19-
arch: x86_64
20-
triplet: x64-windows
21-
cmake-arch: x64
22-
- os: windows-latest
23-
arch: x86
24-
triplet: x86-windows
25-
cmake-arch: win32
26-
- os: windows-latest
27-
arch: arm64
28-
triplet: arm64-windows
29-
cmake-arch: arm64
30-
- os: macos-latest
31-
arch: x86_64
32-
cmake-arch: x86_64
33-
- os: macos-latest
34-
arch: arm64
35-
cmake-arch: arm64
36-
37-
steps:
38-
- uses: actions/checkout@v4.1.7
39-
with:
40-
repository: "madler/zlib"
41-
path: "zlib"
42-
ref: "v1.3.1"
43-
submodules: true
44-
45-
- name: Install Dependencies on Ubuntu
46-
if: matrix.os == 'linux' || matrix.os == 'ubuntu-latest'
47-
run: |
48-
sudo apt-get update
49-
sudo apt-get install -y build-essential cmake
50-
51-
- name: Configure zlib with CMake on Linux
52-
if: matrix.os == 'linux' || matrix.os == 'ubuntu-latest'
53-
run: |
54-
cd zlib
55-
cmake -S ./ -B ./build -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.cmake-arch }} -DZLIB_BUILD_TESTING=OFF -DZLIB_BUILD_SHARED=ON -DZLIB_BUILD_STATIC=OFF
56-
57-
- name: Configure zlib with CMake on Windows
58-
if: matrix.os == 'windows-latest' && matrix.arch != 'arm64'
59-
run: |
60-
cd zlib
61-
cmake -S ./ -B ./build -DCMAKE_BUILD_TYPE=Release -A ${{ matrix.cmake-arch }} -DZLIB_BUILD_TESTING=OFF -DZLIB_BUILD_SHARED=ON -DZLIB_BUILD_STATIC=OFF
62-
63-
- name: Configure zlib with CMake on Windows (ARM64)
64-
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64'
65-
run: |
66-
cd zlib
67-
cmake -S ./ -B ./build -DCMAKE_BUILD_TYPE=Release -A ${{ matrix.cmake-arch }} -DZLIB_BUILD_TESTING=OFF -DZLIB_BUILD_SHARED=ON -DZLIB_BUILD_STATIC=OFF -DCMAKE_SYSTEM_VERSION=10.0.26100.0
68-
69-
- name: Configure zlib with CMake on macOS
70-
if: matrix.os == 'macos-latest'
71-
run: |
72-
cd zlib
73-
cmake -S ./ -B ./build -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=${{ matrix.cmake-arch }} -DZLIB_BUILD_TESTING=OFF -DZLIB_BUILD_SHARED=ON -DZLIB_BUILD_STATIC=OFF
74-
75-
- name: Build zlib
76-
run: cmake --build zlib/build --config Release
77-
78-
- name: Move Windows binaries
79-
if: matrix.os == 'windows-latest'
80-
run: |
81-
mv zlib/build/Release/*.dll zlib/build/
82-
83-
- name: Upload Artifacts
84-
uses: actions/upload-artifact@v4.3.4
85-
with:
86-
name: zlib-${{ matrix.os }}-${{ matrix.arch }}-artifacts
87-
path: |
88-
zlib/build/*.dll
89-
zlib/build/*.so
90-
zlib/build/*.dylib
91-
if-no-files-found: ignore # 'warn' or 'ignore' or 'error'
7+
uses: JunaMeinhold/cmake-actions/.github/workflows/cmake.yml@v1.x.x
8+
with:
9+
lib-name: "zlib"
10+
repo: "madler/zlib"
11+
repo-tag: "v1.3.1"
12+
cmake-flags: "-DCMAKE_BUILD_TYPE=Release -DZLIB_BUILD_TESTING=OFF -DZLIB_BUILD_SHARED=ON -DZLIB_BUILD_STATIC=OFF"
13+
cmake-flags-windows: "-DCMAKE_SYSTEM_VERSION=10.0.26100.0"
14+
ndk-version: "28.1.13356709"
15+
bin-name-osx: "libz.dylib"
16+
bin-name-linux: "libz.so"
17+
bin-name-android: "libz.so"
18+
bin-name-windows: "Release/zlib.dll"
19+
bin-name-osx-normalized: "libz.dylib"
20+
bin-name-linux-normalized: "libz.so"
21+
bin-name-android-normalized: "libz.so"
22+
bin-name-windows-normalized: "zlib.dll"
23+
24+
create-pr:
25+
uses: JunaMeinhold/cmake-actions/.github/workflows/create-pr.yml@v1.x.x
26+
needs: [build]
27+
with:
28+
lib-name: "zlib"
29+
lib-version: "v1.3.1"
30+
pr-branch: zlib-artifacts-branch
31+
pr-base-branch: master
32+
pr-reviewers: JunaMeinhold

hexa-workflows/hexa-workflows.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"zlib": "Hexa.NET.ZLib/native"
3+
}

0 commit comments

Comments
 (0)