-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zlib 1.3 on windows zlib 1.2.13 on alpine linux
- Loading branch information
Showing
6 changed files
with
182 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: zstd | ||
|
||
on: [pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
alpine-musl: | ||
if: ${{ vars.CURRENT_TOOL == github.workflow }} | ||
uses: ./.github/workflows/build-alpine.yml | ||
with: | ||
workflow: ${{ github.workflow }} | ||
version: 3.18.4 | ||
|
||
test-alpine: | ||
needs: alpine-musl | ||
uses: ./.github/workflows/test-alpine.yml | ||
with: | ||
workflow: ${{ github.workflow }} | ||
artifact: build-musl | ||
|
||
test-ubuntu: | ||
needs: alpine-musl | ||
uses: ./.github/workflows/test-ubuntu.yml | ||
with: | ||
workflow: ${{ github.workflow }} | ||
artifact: build-musl | ||
|
||
windows-mingw: | ||
if: ${{ vars.CURRENT_TOOL == github.workflow }} | ||
uses: ./.github/workflows/build-windows-msys2.yml | ||
with: | ||
workflow: ${{ github.workflow }} | ||
msys2_install: make mingw-w64-x86_64-gcc | ||
toolset: mingw | ||
|
||
test-windows: | ||
needs: windows-mingw | ||
uses: ./.github/workflows/test-windows.yml | ||
with: | ||
workflow: ${{ github.workflow }} | ||
artifact: build-mingw | ||
|
||
test-nanoserver: | ||
needs: windows-mingw | ||
uses: ./.github/workflows/test-nanoserver.yml | ||
with: | ||
workflow: ${{ github.workflow }} | ||
artifact: build-mingw | ||
|
||
release: | ||
needs: [test-alpine, | ||
test-ubuntu, | ||
test-windows, | ||
test-nanoserver] | ||
uses: ./.github/workflows/release.yml | ||
with: | ||
workflow: ${{ github.workflow }} | ||
tool_version: '1.5.5' | ||
prepare_body: | | ||
bsdtar -Oxf ./build-musl/build-musl.tar.gz build-musl.md >> body.md | ||
bsdtar -Oxf ./build-mingw/build-mingw.tar.gz build-mingw.md >> body.md | ||
artifacts: ./build-musl/build-musl.tar.gz,./build-mingw/build-mingw.tar.gz | ||
secrets: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
dp0="$(realpath "$(dirname "$0")")" | ||
set -e | ||
|
||
tool_name="zstd" | ||
tool_version="1.5.5" | ||
tool_zlib_version="1.3" | ||
self_toolset_name="build-mingw" | ||
|
||
download_url="https://github.com/facebook/zstd/archive/refs/tags/v$tool_version.tar.gz" | ||
echo "::group::prepare sources $download_url" | ||
|
||
mkdir -p "$dp0/release/build" && cd "$dp0/release" | ||
|
||
"$dp0/../.tools/download_bsdtar.sh" | ||
bsdtar="$dp0/release/bsdtar" | ||
|
||
wget "$download_url" -O "tool-$tool_version.tar.gz" | ||
"$bsdtar" -xf "tool-$tool_version.tar.gz" | ||
|
||
echo "::endgroup::" | ||
|
||
echo "::group::build" | ||
|
||
download_url_zlib="https://github.com/madler/zlib/archive/refs/tags/v$tool_zlib_version.tar.gz" | ||
wget "$download_url_zlib" -O "zlib_tool-$tool_zlib_version.tar.gz" | ||
"$bsdtar" -xf "zlib_tool-$tool_zlib_version.tar.gz" | ||
|
||
make -C "zlib-$tool_zlib_version" -f win32/Makefile.gcc libz.a | ||
|
||
cd "$dp0/release/$tool_name-$tool_version" | ||
export CPPFLAGS=-I"$dp0/release/zlib-$tool_zlib_version" | ||
export LDFLAGS="$dp0/release/zlib-$tool_zlib_version/libz.a" | ||
make -j allzstd MOREFLAGS=-static V=1 | ||
|
||
echo "::endgroup::" | ||
|
||
cp -f "./programs/$tool_name.exe" "$dp0/release/build/" | ||
|
||
cd "$dp0/release/build" | ||
|
||
{ printf '### %s | ||
SHA-256: %s | ||
%s | ||
%s | ||
' "$self_toolset_name.tar.gz" "$(sha256sum $tool_name)" "$download_url_zlib" "$download_url" | ||
} > "$self_toolset_name.md" | ||
|
||
cat "$self_toolset_name.md" | ||
|
||
tar -czvf "../$self_toolset_name.tar.gz" . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
dp0="$(realpath "$(dirname "$0")")" | ||
set -e | ||
|
||
echo "::group::install deps" | ||
|
||
apk update | ||
apk add --no-cache alpine-sdk cmake zlib-dev zlib-static | ||
|
||
echo "::endgroup::" | ||
|
||
tool_name="zstd" | ||
tool_version="1.5.5" | ||
self_toolset_name="build-musl" | ||
|
||
download_url="https://github.com/facebook/zstd/archive/refs/tags/v$tool_version.tar.gz" | ||
echo "::group::prepare sources $download_url" | ||
|
||
mkdir -p "$dp0/release/build" && cd "$dp0/release" | ||
wget "$download_url" -O "tool-$tool_version.tar.gz" | ||
tar -xf "tool-$tool_version.tar.gz" && cd "$tool_name-$tool_version" | ||
|
||
echo "::endgroup::" | ||
|
||
echo "::group::build" | ||
|
||
cmake build/cmake -DZSTD_BUILD_STATIC=ON -DZSTD_USE_STATIC_RUNTIME=ON -DZSTD_BUILD_TESTS=OFF -DCMAKE_EXE_LINKER_FLAGS="-static" | ||
cmake --build . | ||
|
||
echo "::endgroup::" | ||
|
||
cp -f "./programs/$tool_name" "$dp0/release/build/" | ||
|
||
cd "$dp0/release/build" | ||
|
||
strip "$tool_name" | ||
|
||
{ printf '%s | ||
### %s | ||
SHA-256: %s | ||
%s | ||
' "$("./$tool_name" --version)" "$self_toolset_name.tar.gz" "$(sha256sum $tool_name)" "$(apk info zlib-static --webpage)" | ||
} > "$self_toolset_name.md" | ||
|
||
cat "$self_toolset_name.md" | ||
|
||
tar -czvf "../$self_toolset_name.tar.gz" . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
testVersion() { | ||
assertEquals "*** Zstandard CLI (64-bit) v1.5.5, by Yann Collet ***" "$(../bin/zstd --version)" | ||
} | ||
|
||
# Load and run shUnit2. | ||
source "../.tests/shunit2/shunit2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
testVersion() { | ||
assertEquals "*** Zstandard CLI (64-bit) v1.5.5, by Yann Collet ***" "$(../bin/zstd.exe --version)" | ||
} | ||
|
||
# Load and run shUnit2. | ||
source "../.tests/shunit2/shunit2" |