Skip to content

Commit

Permalink
zstd 1.5.5 (#91)
Browse files Browse the repository at this point in the history
zlib 1.3 on windows
zlib 1.2.13 on alpine linux
  • Loading branch information
hemnstill authored Oct 12, 2023
1 parent 1529ea3 commit 0f16604
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/zstd.yml
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 }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/ansible-8.3.0/total?label=⭳%20ansible-8.3.0-core-2.15.3)](https://github.com/hemnstill/StandaloneTools/releases/tag/ansible-8.3.0) | [![GitHub Repo stars](https://img.shields.io/github/stars/ansible/ansible?style=social&label=ansible)](https://github.com/ansible/ansible) [![PyPI](https://img.shields.io/pypi/v/ansible)](https://pypi.org/project/ansible/) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/ansible/ansible)](https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/bsdtar-3.7.1/total?label=⭳%20bsdtar-3.7.1)](https://github.com/hemnstill/StandaloneTools/releases/tag/bsdtar-3.7.1) | [![GitHub Repo stars](https://img.shields.io/github/stars/libarchive/libarchive?style=social&label=libarchive)](https://github.com/libarchive/libarchive) [![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/libarchive/libarchive)](https://github.com/libarchive/libarchive/releases/latest) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/7-Zip-23.01/total?label=⭳%207-Zip-23.01)](https://github.com/hemnstill/StandaloneTools/releases/tag/7-Zip-23.01) | [![SourceForge Downloads](https://img.shields.io/sourceforge/dm/sevenzip?style=social&label=7-Zip)](https://sourceforge.net/projects/sevenzip/) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/zstd-1.5.5/total?label=⭳%20zstd-1.5.5)](https://github.com/hemnstill/StandaloneTools/releases/tag/zstd-1.5.5) | [![GitHub Repo stars](https://img.shields.io/github/stars/facebook/zstd?style=social&label=zstd)](https://github.com/facebook/zstd) [![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/facebook/zstd)](https://github.com/facebook/zstd/releases/latest) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/pg_dump-15.1/total?label=⭳%20pg_dump-15.1)](https://github.com/hemnstill/StandaloneTools/releases/tag/pg_dump-15.1) | [![GitHub Repo stars](https://img.shields.io/github/stars/postgres/postgres?style=social&label=postgres)](https://github.com/postgres/postgres) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/postgres/postgres)](https://www.postgresql.org/docs/current/index.html) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/mysql-8.0.33/total?label=⭳%20mysql-8.0.33)](https://github.com/hemnstill/StandaloneTools/releases/tag/mysql-8.0.33) | [![GitHub Repo stars](https://img.shields.io/github/stars/mysql/mysql-server?style=social&label=mysql-server)](https://github.com/mysql/mysql-server) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/mysql/mysql-server)](https://dev.mysql.com/doc/relnotes/mysql/en/) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/redis-7.0.13/total?label=⭳%20redis-7.0.13)](https://github.com/hemnstill/StandaloneTools/releases/tag/redis-7.0.13) | [![GitHub Repo stars](https://img.shields.io/github/stars/redis/redis?style=social&label=redis)](https://github.com/redis/redis) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/redis/redis)](https://redis.io/download/) |
Expand Down
53 changes: 53 additions & 0 deletions zstd/build_mingw.sh
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" .
49 changes: 49 additions & 0 deletions zstd/build_musl.sh
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" .
8 changes: 8 additions & 0 deletions zstd/test_linux.sh
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"
8 changes: 8 additions & 0 deletions zstd/test_windows.sh
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"

0 comments on commit 0f16604

Please sign in to comment.