-
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.
linux and windows versions. rmyorston/busybox-w32#209
- Loading branch information
Showing
6 changed files
with
185 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,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 }} |
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,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 . |
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,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 . |
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 "tar (busybox) 1.35.0" "$(../bin/busybox tar --version | head -1)" | ||
} | ||
|
||
# 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 "tar (busybox) 1.35.0.git" "$(../bin/busybox.exe tar --version | head -1)" | ||
} | ||
|
||
# Load and run shUnit2. | ||
source "../.tests/shunit2/shunit2" |