Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap ityfuzz CLI #228

Merged
merged 3 commits into from
Oct 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,22 +169,26 @@ jobs:
VERSION_NAME: ${{ (env.IS_NIGHTLY && 'nightly') || needs.prepare.outputs.tag_name }}
shell: bash
run: |
if [ "$PLATFORM_NAME" == "linux" ]; then
mv "./target_f/${TARGET}/release/ityfuzz" "./target/${TARGET}/release/ityfuzz_f"
tar -czvf "ityfuzz_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release ityfuzz ityfuzz_f
echo "file_name=ityfuzz_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
elif [ "$PLATFORM_NAME" == "darwin" ]; then
mv "./target_f/${TARGET}/release/ityfuzz" "./target/${TARGET}/release/ityfuzz_f"
# We need to use gtar here otherwise the archive is corrupt.
# See: https://github.com/actions/virtual-environments/issues/2619
gtar -czvf "ityfuzz_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release ityfuzz ityfuzz_f
echo "file_name=ityfuzz_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
else
if [ "$PLATFORM_NAME" == "win32" ]; then
mv "./target/${TARGET}/release/ityfuzz.exe" "./target/${TARGET}/release/ityfuzz_.exe"
mv "./target_f/${TARGET}/release/ityfuzz.exe" "./target/${TARGET}/release/ityfuzz_f.exe"
echo 'param($args) if ($args -match "-o " -or $args -match "--onchain" -or $args -match "-o$" -or $args -match "--onchain$") { ityfuzz_f.exe $args } else { ityfuzz_.exe $args }' > "./target/${TARGET}/release/ityfuzz.ps1"
cd ./target/${TARGET}/release
7z a -tzip "ityfuzz_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" ityfuzz.exe ityfuzz_f.exe
7z a -tzip "ityfuzz_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" ityfuzz.ps1 ityfuzz_.exe ityfuzz_f.exe
mv "ityfuzz_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" ../../../
echo "file_name=ityfuzz_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" >> $GITHUB_OUTPUT
else
mv "./target/${TARGET}/release/ityfuzz" "./target/${TARGET}/release/ityfuzz_"
mv "./target_f/${TARGET}/release/ityfuzz" "./target/${TARGET}/release/ityfuzz_f"
echo -e '#!/bin/bash\nif [[ "$@" == *"-o "* ]] || [[ "$@" =~ "-o"$ ]] || [[ "$@" == *"--onchain "* ]] || [[ "$@" =~ "--onchain"$ ]]; then\n ./ityfuzz_f "$@"\nelse\n ./ityfuzz_ "$@"\nfi' > "./target/${TARGET}/release/ityfuzz"
if [ "$PLATFORM_NAME" == "linux" ]; then
tar -czvf "ityfuzz_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release ityfuzz ityfuzz_ ityfuzz_f
else
# We need to use gtar here otherwise the archive is corrupt.
# See: https://github.com/actions/virtual-environments/issues/2619
gtar -czvf "ityfuzz_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release ityfuzz ityfuzz_ ityfuzz_f
fi
echo "file_name=ityfuzz_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
fi

# Creates the release for this specific version
Expand Down