Skip to content

Commit 8f35444

Browse files
committed
Add ripunzip build workflow
1 parent 8119a27 commit 8f35444

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

.github/workflows/build-ripunzip.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Build runzip
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
ripunzip-version:
7+
description: "what reference to checktout from google/runzip"
8+
required: false
9+
default: v1.2.1
10+
11+
jobs:
12+
build:
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-20.04, macos-12, windows-2019]
17+
runs-on: ${{ matrix.os }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
repository: google/ripunzip
22+
ref: ${{ inputs.ripunzip-version }}
23+
# we need to avoid ripunzip dynamically linking into libssl
24+
# see https://github.com/sfackler/rust-openssl/issues/183
25+
- if: runner.os == 'Linux'
26+
name: checkout openssl
27+
uses: actions/checkout@v4
28+
with:
29+
repository: openssl/openssl
30+
path: openssl
31+
ref: openssl-3.3.0
32+
- if: runner.os == 'Linux'
33+
name: build and install openssl with fPIC
34+
shell: bash
35+
working-directory: openssl
36+
run: |
37+
./config -fPIC --prefix=$HOME/.local/bin --openssldir=$HOME/.local/ssl
38+
make -j $(nproc)
39+
make install -j $(nproc)
40+
- if: runner.os == 'Linux'
41+
name: build (linux)
42+
shell: bash
43+
run: |
44+
env OPENSSL_LIB_DIR=/usr/local/lib64 OPENSSL_INCLUDE_DIR=/usr/local/include OPENSSL_STATIC=yes cargo build --release
45+
mv target/release/ripunzip ripunzip-linux
46+
- if: runner.os == 'Windows'
47+
name: build (windows)
48+
shell: bash
49+
run: |
50+
cargo build --release
51+
mv target/release/ripunzip ripunzip-windows
52+
- shell: bash
53+
if: runner.os == 'macOS'
54+
run: |
55+
rustup target install x86_64-apple-darwin
56+
rustup target install aarch64-apple-darwin
57+
cargo build --target x86_64-apple-darwin --release
58+
cargo build --target aarch64-apple-darwin --release
59+
lipo -create -output ripunzip-macos \
60+
-arch x86_64 target/x86_64-apple-darwin/release/ripunzip \
61+
-arch arm64 target/aarch64-apple-darwin/release/ripunzip
62+
- uses: actions/upload-artifact@v4
63+
with:
64+
name: ripunzip-${{ runner.os }}
65+
path: ripunzip-*
66+
- bash: shell
67+
run: |
68+
./ripunzip-* --version

0 commit comments

Comments
 (0)