Skip to content

Commit

Permalink
bsdtar with zstd (#18)
Browse files Browse the repository at this point in the history
dispose of ci-test-run.yml
  • Loading branch information
hemnstill authored Apr 2, 2022
1 parent 3be14a1 commit 58d99be
Show file tree
Hide file tree
Showing 9 changed files with 284 additions and 140 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/bsdtar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: bsdtar

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 }}

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

alpine-musl-test:
needs: alpine-musl
if: ${{ needs.prejob.outputs.workflow == github.workflow }}
uses: ./.github/workflows/test-alpine.yml
with:
artifact: build-musl
test-run: |
./${{ github.workflow }} --version
windows-mingw-test:
needs: windows-mingw
if: ${{ needs.prejob.outputs.workflow == github.workflow }}
uses: ./.github/workflows/test-windows.yml
with:
artifact: build-mingw
test-run: |
./${{ github.workflow }} --version
release:
needs: [alpine-musl-test,
windows-mingw-test]
uses: ./.github/workflows/release.yml
with:
workflow: ${{ github.workflow }}
tool_version: '3.6.0-zstd'
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 }}
24 changes: 24 additions & 0 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
workflow_call:
inputs:
workflow:
required: true
type: string
toolset:
required: false
type: string
default: 'mingw'

jobs:
build-windows:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: build ${{ inputs.workflow }}-windows-${{ inputs.toolset }}
run: |
.tools\busybox64.exe sh ${{ inputs.workflow }}\build_${{ inputs.toolset }}.sh
- uses: actions/upload-artifact@v3
with:
name: build-${{ inputs.toolset }}
path: ./${{ inputs.workflow }}/release/build-${{ inputs.toolset }}.tar.gz
129 changes: 0 additions & 129 deletions .github/workflows/ci-test-run.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/pcre2grep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: pcre2grep

on: [pull_request, workflow_dispatch]

jobs:
prejob:
runs-on: ubuntu-latest
environment: release
outputs:
tool: ${{ steps.setvar.outputs.envvar }}
steps:
- id: setvar
run: |
echo ${{ secrets._CURRENT_TOOL }} > CI_ENV
echo "::set-output name=envvar::$(sed -e 's/^_//' CI_ENV)"
- run: echo CURRENT_TOOL '${{ steps.setvar.outputs.envvar }}'

alpine-pcre2grep-linux:
needs: prejob
if: ${{ needs.prejob.outputs.tool=='pcre2grep' }}
runs-on: ubuntu-latest
container: alpine:3.15.0
steps:
- uses: actions/checkout@v2
- name: build
id: build
run: |
apk add --no-cache bash
./pcre2grep/build.sh
- uses: ncipollo/release-action@v1
with:
tag: '${{ steps.build.outputs.tool_name }}-${{ steps.build.outputs.tool_version }}'
bodyFile: './pcre2grep/release/body.md'
artifacts: './pcre2grep/release/${{ steps.build.outputs.tool_name }}'
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}

24 changes: 24 additions & 0 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
workflow_call:
inputs:
artifact:
required: true
type: string
test-run:
required: true
type: string

jobs:
test-windows:
runs-on: windows-latest
steps:
- uses: actions/download-artifact@v3
with:
name: ${{ inputs.artifact }}
path: .

- name: Test ${{ inputs.artifact }} build on windows-latest
run: |
tar -xf ./${{ inputs.artifact }}.tar.gz
${{ inputs.test-run }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Standalone (static) tools:
| releases | project |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/bsdtar-3.6.0/total?label=⭳%20bsdtar-3.6.0)](https://github.com/hemnstill/StandaloneTools/releases/tag/bsdtar-3.6.0) | [![GitHub Repo stars](https://img.shields.io/github/stars/libarchive/libarchive?style=social&label=libarchive)](https://github.com/libarchive/libarchive) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/bsdtar-3.6.0-zstd/total?label=⭳%20bsdtar-3.6.0-zstd)](https://github.com/hemnstill/StandaloneTools/releases/tag/bsdtar-3.6.0-zstd) | [![GitHub Repo stars](https://img.shields.io/github/stars/libarchive/libarchive?style=social&label=libarchive)](https://github.com/libarchive/libarchive) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/pcre2grep-10.39/total?label=⭳%20pcre2grep-10.39)](https://github.com/hemnstill/StandaloneTools/releases/tag/pcre2grep-10.39) | [![GitHub Repo stars](https://img.shields.io/github/stars/PhilipHazel/pcre2?style=social&label=PCRE2)](https://github.com/PhilipHazel/pcre2) |
| [![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 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) |
8 changes: 4 additions & 4 deletions bsdtar/build_mingw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mkdir -p "$dp0/release" && cd "$dp0/release"
wget "$download_url" -O "libarchive-$tool_version.tar.gz"
tar -xf "libarchive-$tool_version.tar.gz" && cd "libarchive-$tool_version"

wget "https://github.com/libarchive/libarchive/raw/v$tool_version/build/ci/github_actions/ci.cmd" -O "$dp0/ci.cmd"
cp -f "../ci.cmd" "../../"

echo "::endgroup::"

Expand All @@ -35,8 +35,8 @@ cp -f "$dp0/release/libarchive-$tool_version/build_ci/cmake/bin/$tool_name" "."
%s
%s
' "$(sha256sum $tool_name)" "$("./$tool_name" --version)" "$download_url"
} > _mingw.md
} > build-mingw.md

cat _mingw.md
cat build-mingw.md

tar -czvf ../_mingw.tar.gz .
tar -czvf ../build-mingw.tar.gz .
12 changes: 6 additions & 6 deletions bsdtar/build.sh → bsdtar/build_musl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
echo "::group::install deps"

apk update
apk add --no-cache alpine-sdk zlib-dev bzip2-dev zlib-static bzip2-static xz-dev
apk add --no-cache alpine-sdk zlib-dev zlib-static xz-dev zstd-dev zstd-static

echo "::endgroup::"

Expand Down Expand Up @@ -40,8 +40,8 @@ gcc -static -o "$dp0/release/build/$tool_name" \
.libs/libarchive.a \
.libs/libarchive_fe.a \
/lib/libz.a \
/usr/lib/libbz2.a \
/usr/lib/liblzma.a
/usr/lib/liblzma.a \
/usr/lib/libzstd.a

echo "::endgroup::"

Expand All @@ -52,8 +52,8 @@ chmod +x "$tool_name"
{ printf 'SHA-256: %s
%s
' "$(sha256sum $tool_name)" "$("./$tool_name" --version)"
} > _musl.md
} > build-musl.md

cat _musl.md
cat build-musl.md

tar -czvf ../_musl.tar.gz .
tar -czvf ../build-musl.tar.gz .
Loading

0 comments on commit 58d99be

Please sign in to comment.