Skip to content

Commit

Permalink
busybox 1.35 (#26)
Browse files Browse the repository at this point in the history
linux and windows versions.

rmyorston/busybox-w32#209
  • Loading branch information
hemnstill authored Jun 5, 2022
1 parent c0f3fbf commit 5526eb4
Show file tree
Hide file tree
Showing 6 changed files with 185 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/busybox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: busybox

on: [pull_request, workflow_dispatch]

jobs:
prejob:
uses: ./.github/workflows/set-output-workflow.yml
with:
workflow: ${{ github.workflow }}
secrets:
_WORKFLOW: ${{ secrets._CURRENT_TOOL }}

alpine-musl:
needs: prejob
if: ${{ needs.prejob.outputs.workflow == github.workflow }}
uses: ./.github/workflows/build-alpine.yml
with:
workflow: ${{ github.workflow }}

alpine-mingw:
needs: prejob
if: ${{ needs.prejob.outputs.workflow == github.workflow }}
uses: ./.github/workflows/build-alpine.yml
with:
workflow: ${{ github.workflow }}
toolset: mingw

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

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

test-windows:
needs: alpine-mingw
if: ${{ needs.prejob.outputs.workflow == github.workflow }}
uses: ./.github/workflows/test-windows.yml
with:
workflow: ${{ github.workflow }}
artifact: build-mingw

test-nanoserver:
needs: alpine-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.35'
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 @@ -6,5 +6,6 @@
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/openssl-3.0.1/total?label=⭳%20openssl-3.0.1)](https://github.com/hemnstill/StandaloneTools/releases/tag/openssl-3.0.1) <br/>[![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/openssl-1_1_1m/total?label=⭳%20openssl-1_1_1m)](https://github.com/hemnstill/StandaloneTools/releases/tag/openssl-1_1_1m) | [![GitHub Repo stars](https://img.shields.io/github/stars/openssl/openssl?style=social&label=OpenSSL)](https://github.com/openssl/openssl) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/openssl/openssl)](https://www.openssl.org/news/changelog.html) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/far2l-2.4.0-beta/total?label=⭳%20far2l-2.4.0-beta)](https://github.com/hemnstill/StandaloneTools/releases/tag/far2l-2.4.0-beta) | [![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/pg_dump-14.2/total?label=⭳%20pg_dump-14.2)](https://github.com/hemnstill/StandaloneTools/releases/tag/pg_dump-14.2) | [![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/busybox-1.35/total?label=⭳%20busybox-1.35.0-FRP-4487)](https://github.com/hemnstill/StandaloneTools/releases/tag/busybox-1.35) | [![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) |


44 changes: 44 additions & 0 deletions busybox/build_mingw.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash
dp0="$(realpath "$(dirname "$0")")"
set -e

echo "::group::install deps"

apk update
apk add --no-cache alpine-sdk make linux-headers mingw-w64-gcc

echo "::endgroup::"

tool_name="busybox.exe"
tool_version="FRP-4487-gd239d2d52"
echo "::set-output name=tool_name::$tool_name"
echo "::set-output name=tool_version::$tool_version"

download_url="https://github.com/rmyorston/busybox-w32/archive/refs/tags/$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 "busybox-w32-$tool_version"

echo "::endgroup::"

echo "::group::build"

make -j$(nproc) mingw64_defconfig
make -j$(nproc) busybox.exe

echo "::endgroup::"

cp -f "./$tool_name" "$dp0/release/build/"

cd "$dp0/release/build"

{ printf 'SHA-256: %s
%s
' "$(sha256sum $tool_name)" "$download_url"
} > build-mingw.md

cat build-mingw.md

tar -czvf ../build-mingw.tar.gz .
51 changes: 51 additions & 0 deletions busybox/build_musl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/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="busybox"
tool_version="1.35.0"
echo "::set-output name=tool_name::$tool_name"
echo "::set-output name=tool_version::$tool_version"

download_url="https://busybox.net/downloads/busybox-$tool_version.tar.bz2"
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 "busybox-$tool_version"

echo "::endgroup::"

echo "::group::build"

make -j$(nproc) defconfig
sed -e 's/.*STATIC[^_].*/CONFIG_STATIC=y/' -i .config
make -j$(nproc) busybox

echo "::endgroup::"

cp -f "./$tool_name" "$dp0/release/build/"

cd "$dp0/release/build"

strip "./$tool_name"

{ printf '```
%s
```
SHA-256: %s
%s
' "$(./$tool_name)" "$(sha256sum $tool_name)" "$download_url"
} > build-musl.md

cat build-musl.md

tar -czvf ../build-musl.tar.gz .
8 changes: 8 additions & 0 deletions busybox/test_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

testVersion() {
assertEquals "tar (busybox) 1.35.0" "$(../bin/busybox tar --version | head -1)"
}

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

testVersion() {
assertEquals "tar (busybox) 1.35.0.git" "$(../bin/busybox.exe tar --version | head -1)"
}

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

0 comments on commit 5526eb4

Please sign in to comment.