Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redis cli #90

Merged
merged 50 commits into from
Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
49578d3
redis cli
hemnstill Sep 15, 2023
22d81dc
cd "redis-$tool_version"
hemnstill Sep 15, 2023
80bea3e
make
hemnstill Sep 15, 2023
e8d932a
static
hemnstill Sep 15, 2023
47c9d91
tests
hemnstill Sep 15, 2023
52282ab
redis-cli 7.2.1
hemnstill Sep 15, 2023
8dc82ca
ubuntu-musl-test
hemnstill Sep 15, 2023
84bd77d
musl-dev openssl-dev
hemnstill Sep 15, 2023
4d02d02
- dev
hemnstill Sep 15, 2023
204ea34
windows-msys
hemnstill Sep 16, 2023
f1ef80b
GITHUB_TOKEN
hemnstill Sep 16, 2023
4167dc7
- setup dotnet
hemnstill Sep 16, 2023
bfc8413
msys build
hemnstill Sep 16, 2023
cd6c36a
defaults
hemnstill Sep 16, 2023
2e32d39
fix example
hemnstill Sep 16, 2023
5e58c57
defaults -> msys
hemnstill Sep 16, 2023
f4391c4
cp by ext
hemnstill Sep 16, 2023
52ec820
d:
hemnstill Sep 16, 2023
db57a17
msys sed
hemnstill Sep 16, 2023
073186e
test-windows
hemnstill Sep 16, 2023
3ddb149
sed busybox
hemnstill Sep 16, 2023
126e9a7
musl build_tls = false
hemnstill Sep 16, 2023
d06274b
msys2
hemnstill Sep 16, 2023
9ade228
BB_OVERRIDE_APPLETS
hemnstill Sep 16, 2023
f6213d4
replace busybox.exe
hemnstill Sep 16, 2023
0245c00
busybox -> msys2
hemnstill Sep 16, 2023
a77a36d
msys -> msys2
hemnstill Sep 16, 2023
f24324b
run sh
hemnstill Sep 16, 2023
afacd6d
sh
hemnstill Sep 16, 2023
cc01fc5
msys2
hemnstill Sep 16, 2023
d915688
/
hemnstill Sep 16, 2023
d835193
bash?
hemnstill Sep 16, 2023
de40dd1
check windows os on msys
hemnstill Sep 16, 2023
2000bb9
bsdtar -> tar
hemnstill Sep 16, 2023
cd2dbe7
7.0.13
hemnstill Sep 16, 2023
0bca091
Revert "replace busybox.exe"
hemnstill Sep 16, 2023
bbb1788
7.0.13
hemnstill Sep 16, 2023
e597071
try static
hemnstill Sep 16, 2023
657fe9b
copy msys-*.dll's
hemnstill Sep 16, 2023
edb87a0
copy only 3 msys dll
hemnstill Sep 16, 2023
da4aab9
uname test
hemnstill Sep 16, 2023
cb9d226
use 7.0.13
hemnstill Sep 16, 2023
a5873b5
use bsdtar
hemnstill Sep 16, 2023
1fc10f3
release 7.0.13
hemnstill Sep 16, 2023
7ecf6fd
msys2_install
hemnstill Sep 16, 2023
6fdd011
README.md
hemnstill Sep 16, 2023
80e719b
shasum under spoiler
hemnstill Sep 16, 2023
8fd69d2
download url
hemnstill Sep 16, 2023
bdd47f7
$bsdtar
hemnstill Sep 16, 2023
a3a6f60
-python
hemnstill Sep 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/build-windows-msys2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
on:
workflow_call:
inputs:
workflow:
required: true
type: string
toolset:
required: false
type: string
default: 'msys2'
msys2_install:
required: true
type: string

jobs:
build-windows:
runs-on: windows-2019

steps:
- uses: actions/checkout@v3

- uses: msys2/setup-msys2@v2
with:
update: true
install: ${{ inputs.msys2_install }}

- name: build ${{ inputs.workflow }}-windows-${{ inputs.toolset }}
run: |
bash ${{ inputs.workflow }}/build_${{ inputs.toolset }}.sh
shell:
msys2 {0}

- uses: actions/upload-artifact@v3
with:
name: build-${{ inputs.toolset }}
path: ./${{ inputs.workflow }}/release/build-${{ inputs.toolset }}.tar.gz
56 changes: 56 additions & 0 deletions .github/workflows/redis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: redis

on: [pull_request, workflow_dispatch]

jobs:
alpine-musl:
if: ${{ vars.CURRENT_TOOL == github.workflow }}
uses: ./.github/workflows/build-alpine.yml
with:
workflow: ${{ github.workflow }}
toolset: musl
version: 3.16

alpine-musl-test:
needs: alpine-musl
uses: ./.github/workflows/test-alpine.yml
with:
workflow: ${{ github.workflow }}
artifact: build-musl

ubuntu-musl-test:
needs: alpine-musl
uses: ./.github/workflows/test-ubuntu.yml
with:
workflow: ${{ github.workflow }}
artifact: build-musl

windows-msys2:
if: ${{ vars.CURRENT_TOOL == github.workflow }}
uses: ./.github/workflows/build-windows-msys2.yml
with:
workflow: ${{ github.workflow }}
msys2_install: gcc make pkg-config libopenssl openssl-devel mingw-w64-x86_64-libc++

test-windows:
needs: windows-msys2
if: ${{ vars.CURRENT_TOOL == github.workflow }}
uses: ./.github/workflows/test-windows.yml
with:
workflow: ${{ github.workflow }}
artifact: build-msys2

release:
needs: [alpine-musl-test,
ubuntu-musl-test,
test-windows]
uses: ./.github/workflows/release.yml
with:
workflow: ${{ github.workflow }}
tool_version: '7.0.13'
prepare_body: |
bsdtar -Oxf ./build-musl/build-musl.tar.gz build-musl.md >> body.md
bsdtar -Oxf ./build-msys2/build-msys2.tar.gz build-msys2.md >> body.md
artifacts: ./build-musl/build-musl.tar.gz,./build-msys2/build-msys2.tar.gz
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .tools/download_bsdtar.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

is_windows_os=false && [[ $(uname) == Windows_NT* ]] && is_windows_os=true
is_windows_os=false && [[ $(uname) == Windows_NT* || $(uname) == MINGW64_NT* ]] && is_windows_os=true

echo "download bsdtar ..."
bsdtar_version=3.7.1
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
| [![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/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/) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/busybox-1.35.0-FRP-4784/total?label=⭳%20busybox-1.35.0-FRP-4784)](https://github.com/hemnstill/StandaloneTools/releases/tag/busybox-1.35.0-FRP-4784) | [![GitHub Repo stars](https://img.shields.io/github/stars/rmyorston/busybox-w32?style=social&label=busybox-w32)](https://github.com/rmyorston/busybox-w32) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/rmyorston/busybox-w32)](https://frippery.org/busybox/release-notes/current.html) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/far2l-2.5.2/total?label=⭳%20far2l-2.5.2)](https://github.com/hemnstill/StandaloneTools/releases/tag/far2l-2.5.2) | [![GitHub Repo stars](https://img.shields.io/github/stars/elfmz/far2l?style=social&label=far2l)](https://github.com/elfmz/far2l) [![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/elfmz/far2l)](https://github.com/elfmz/far2l/releases/latest) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/pcre2grep-10.40/total?label=⭳%20pcre2grep-10.40)](https://github.com/hemnstill/StandaloneTools/releases/tag/pcre2grep-10.40) | [![GitHub Repo stars](https://img.shields.io/github/stars/PCRE2Project/pcre2?style=social&label=PCRE2)](https://github.com/PCRE2Project/pcre2) [![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/PCRE2Project/pcre2)](https://github.com/PCRE2Project/pcre2/releases/latest) |
Expand Down
59 changes: 59 additions & 0 deletions redis/build_msys2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash
dp0="$(realpath "$(dirname "$0")")"
set -e

tool_name="redis"
tool_version="7.0.13"
self_toolset_name="build-msys2"
release_version_dirpath="$dp0/release/build"

mkdir -p "$release_version_dirpath" && cd "$dp0/release"

download_url="https://github.com/redis/redis/archive/refs/tags/$tool_version.tar.gz"
echo "::group::prepare sources $download_url"

"$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" && cd "$tool_name-$tool_version"

echo "::endgroup::"

echo "::group::build"

sed -i 's/__GNU_VISIBLE/1/' /d/a/_temp/msys64/usr/include/dlfcn.h

make BUILD_TLS=yes

echo "::endgroup::"

cp -f /d/a/_temp/msys64/usr/bin/msys-2.0.dll "$release_version_dirpath/"
cp -f /d/a/_temp/msys64/usr/bin/msys-crypto-3.dll "$release_version_dirpath/"
cp -f /d/a/_temp/msys64/usr/bin/msys-ssl-3.dll "$release_version_dirpath/"

find ./src -mindepth 1 -maxdepth 1 -name '*.exe' -exec cp -f "{}" "$release_version_dirpath/" \;

cd "$release_version_dirpath"

find . -mindepth 1 -maxdepth 1 -exec strip "{}" \;

{ printf '### %s
%s

<details>
<summary>sha256sum ./*</summary>

```
%s
```
</details>

%s

' "$self_toolset_name.tar.gz" "$(./redis-cli --version)" "$(sha256sum ./*)" "$download_url"
} > "$self_toolset_name.md"

cat "$self_toolset_name.md"

"$bsdtar" -czvf "../$self_toolset_name.tar.gz" .
63 changes: 63 additions & 0 deletions redis/build_musl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash
dp0="$(realpath "$(dirname "$0")")"
set -e

echo "::group::install deps"

apk update
apk add --no-cache alpine-sdk make linux-headers

echo "::endgroup::"

tool_name="redis"
tool_version="7.0.13"
self_toolset_name="build-musl"
release_version_dirpath="$dp0/release/build"

mkdir -p "$release_version_dirpath" && cd "$dp0/release"

download_url="https://github.com/redis/redis/archive/refs/tags/$tool_version.tar.gz"
echo "::group::prepare sources $download_url"

"$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" && cd "$tool_name-$tool_version"

echo "::endgroup::"

echo "::group::build"

make CFLAGS="-static" LDFLAGS="-static"

echo "::endgroup::"

cp -f "./src/redis-cli" "$release_version_dirpath/"
cp -f "./src/redis-server" "$release_version_dirpath/"
cp -f "./src/redis-benchmark" "$release_version_dirpath/"
cp -f "./src/redis-sentinel" "$release_version_dirpath/"
cp -f "./src/redis-check-rdb" "$release_version_dirpath/"
cp -f "./src/redis-check-aof" "$release_version_dirpath/"

cd "$release_version_dirpath"

find . -mindepth 1 -maxdepth 1 -exec strip "{}" \;

{ printf '### %s
%s

<details>
<summary>sha256sum ./*</summary>

```
%s
```
</details>

' "$self_toolset_name.tar.gz" "$(./redis-cli --version)" "$(sha256sum ./*)"
} > "$self_toolset_name.md"

cat "$self_toolset_name.md"

"$bsdtar" -czvf "../$self_toolset_name.tar.gz" .
8 changes: 8 additions & 0 deletions redis/test_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

testVersion() {
assertEquals "redis-cli 7.0.13" "$(../bin/redis-cli --version)"
}

# Load and run shUnit2.
source "../.tests/shunit2/shunit2"
8 changes: 8 additions & 0 deletions redis/test_windows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

testVersion() {
assertEquals "redis-cli 7.0.13" "$(../bin/redis-cli.exe --version)"
}

# Load and run shUnit2.
source "../.tests/shunit2/shunit2"
Loading