Skip to content

Commit

Permalink
Wrap ityfuzz CLI (#228)
Browse files Browse the repository at this point in the history
* Wrap ityfuzz CLI

* Wrap ityfuzz CLI

* Wrap ityfuzz CLI
  • Loading branch information
0xAWM authored Oct 6, 2023
1 parent 1549be9 commit d6ec3b6
Showing 1 changed file with 16 additions and 12 deletions.
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

0 comments on commit d6ec3b6

Please sign in to comment.