Skip to content

Commit 58d99be

Browse files
authored
bsdtar with zstd (#18)
dispose of ci-test-run.yml
1 parent 3be14a1 commit 58d99be

9 files changed

+284
-140
lines changed

.github/workflows/bsdtar.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: bsdtar
2+
3+
on: [pull_request, workflow_dispatch]
4+
5+
jobs:
6+
prejob:
7+
uses: ./.github/workflows/set-output-workflow.yml
8+
with:
9+
workflow: ${{ github.workflow }}
10+
secrets:
11+
_WORKFLOW: ${{ secrets._CURRENT_TOOL }}
12+
13+
alpine-musl:
14+
needs: prejob
15+
if: ${{ needs.prejob.outputs.workflow == github.workflow }}
16+
uses: ./.github/workflows/build-alpine.yml
17+
with:
18+
workflow: ${{ github.workflow }}
19+
20+
windows-mingw:
21+
needs: prejob
22+
if: ${{ needs.prejob.outputs.workflow == github.workflow }}
23+
uses: ./.github/workflows/build-windows.yml
24+
with:
25+
workflow: ${{ github.workflow }}
26+
27+
alpine-musl-test:
28+
needs: alpine-musl
29+
if: ${{ needs.prejob.outputs.workflow == github.workflow }}
30+
uses: ./.github/workflows/test-alpine.yml
31+
with:
32+
artifact: build-musl
33+
test-run: |
34+
./${{ github.workflow }} --version
35+
36+
windows-mingw-test:
37+
needs: windows-mingw
38+
if: ${{ needs.prejob.outputs.workflow == github.workflow }}
39+
uses: ./.github/workflows/test-windows.yml
40+
with:
41+
artifact: build-mingw
42+
test-run: |
43+
./${{ github.workflow }} --version
44+
45+
release:
46+
needs: [alpine-musl-test,
47+
windows-mingw-test]
48+
uses: ./.github/workflows/release.yml
49+
with:
50+
workflow: ${{ github.workflow }}
51+
tool_version: '3.6.0-zstd'
52+
prepare_body: |
53+
bsdtar -Oxf ./build-musl/build-musl.tar.gz build-musl.md >> body.md
54+
bsdtar -Oxf ./build-mingw/build-mingw.tar.gz build-mingw.md >> body.md
55+
artifacts: ./build-musl/build-musl.tar.gz,./build-mingw/build-mingw.tar.gz
56+
secrets:
57+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/build-windows.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
workflow:
5+
required: true
6+
type: string
7+
toolset:
8+
required: false
9+
type: string
10+
default: 'mingw'
11+
12+
jobs:
13+
build-windows:
14+
runs-on: windows-2019
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: build ${{ inputs.workflow }}-windows-${{ inputs.toolset }}
18+
run: |
19+
.tools\busybox64.exe sh ${{ inputs.workflow }}\build_${{ inputs.toolset }}.sh
20+
21+
- uses: actions/upload-artifact@v3
22+
with:
23+
name: build-${{ inputs.toolset }}
24+
path: ./${{ inputs.workflow }}/release/build-${{ inputs.toolset }}.tar.gz

.github/workflows/ci-test-run.yml

-129
This file was deleted.

.github/workflows/pcre2grep.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: pcre2grep
2+
3+
on: [pull_request, workflow_dispatch]
4+
5+
jobs:
6+
prejob:
7+
runs-on: ubuntu-latest
8+
environment: release
9+
outputs:
10+
tool: ${{ steps.setvar.outputs.envvar }}
11+
steps:
12+
- id: setvar
13+
run: |
14+
echo ${{ secrets._CURRENT_TOOL }} > CI_ENV
15+
echo "::set-output name=envvar::$(sed -e 's/^_//' CI_ENV)"
16+
- run: echo CURRENT_TOOL '${{ steps.setvar.outputs.envvar }}'
17+
18+
alpine-pcre2grep-linux:
19+
needs: prejob
20+
if: ${{ needs.prejob.outputs.tool=='pcre2grep' }}
21+
runs-on: ubuntu-latest
22+
container: alpine:3.15.0
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: build
26+
id: build
27+
run: |
28+
apk add --no-cache bash
29+
./pcre2grep/build.sh
30+
31+
- uses: ncipollo/release-action@v1
32+
with:
33+
tag: '${{ steps.build.outputs.tool_name }}-${{ steps.build.outputs.tool_version }}'
34+
bodyFile: './pcre2grep/release/body.md'
35+
artifacts: './pcre2grep/release/${{ steps.build.outputs.tool_name }}'
36+
allowUpdates: true
37+
token: ${{ secrets.GITHUB_TOKEN }}
38+

.github/workflows/test-windows.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
artifact:
5+
required: true
6+
type: string
7+
test-run:
8+
required: true
9+
type: string
10+
11+
jobs:
12+
test-windows:
13+
runs-on: windows-latest
14+
steps:
15+
- uses: actions/download-artifact@v3
16+
with:
17+
name: ${{ inputs.artifact }}
18+
path: .
19+
20+
- name: Test ${{ inputs.artifact }} build on windows-latest
21+
run: |
22+
tar -xf ./${{ inputs.artifact }}.tar.gz
23+
${{ inputs.test-run }}
24+

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Standalone (static) tools:
22
| releases | project |
33
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
4-
| [![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) |
4+
| [![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) |
55
| [![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) |
66
| [![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) |
77
| [![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) |

bsdtar/build_mingw.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ mkdir -p "$dp0/release" && cd "$dp0/release"
1414
wget "$download_url" -O "libarchive-$tool_version.tar.gz"
1515
tar -xf "libarchive-$tool_version.tar.gz" && cd "libarchive-$tool_version"
1616

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

1919
echo "::endgroup::"
2020

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

40-
cat _mingw.md
40+
cat build-mingw.md
4141

42-
tar -czvf ../_mingw.tar.gz .
42+
tar -czvf ../build-mingw.tar.gz .

bsdtar/build.sh bsdtar/build_musl.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -e
55
echo "::group::install deps"
66

77
apk update
8-
apk add --no-cache alpine-sdk zlib-dev bzip2-dev zlib-static bzip2-static xz-dev
8+
apk add --no-cache alpine-sdk zlib-dev zlib-static xz-dev zstd-dev zstd-static
99

1010
echo "::endgroup::"
1111

@@ -40,8 +40,8 @@ gcc -static -o "$dp0/release/build/$tool_name" \
4040
.libs/libarchive.a \
4141
.libs/libarchive_fe.a \
4242
/lib/libz.a \
43-
/usr/lib/libbz2.a \
44-
/usr/lib/liblzma.a
43+
/usr/lib/liblzma.a \
44+
/usr/lib/libzstd.a
4545

4646
echo "::endgroup::"
4747

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

57-
cat _musl.md
57+
cat build-musl.md
5858

59-
tar -czvf ../_musl.tar.gz .
59+
tar -czvf ../build-musl.tar.gz .

0 commit comments

Comments
 (0)