Skip to content
This repository has been archived by the owner on Jul 14, 2024. It is now read-only.

Commit

Permalink
Use my own compression script
Browse files Browse the repository at this point in the history
  • Loading branch information
fido-node committed Dec 28, 2023
1 parent b916e5e commit 73cd648
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
23 changes: 23 additions & 0 deletions .github/compress.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

if [ "$#" -ne 2 ]; then
echo "Usage: $0 <folder_path> <archive_base_name>"
exit 1
fi

folder_path="$1"
archive_base_name="$2"
output_dir="$(pwd)"

# Check if the folder path contains "apple"
if [[ "$folder_path" == *"apple"* ]]; then
# Use zip if "apple" is in the folder path
archive_name="$archive_base_name.zip"
zip -j "$output_dir/$archive_name" "$folder_path/rusty_belt_server" "$folder_path/tmux_client"
else
# Use tar.gz for other cases
archive_name="$archive_base_name.tar.gz"
tar -czf "$output_dir/$archive_name" -C "$folder_path" rusty_belt_server tmux_client
fi

echo "Archive created: $output_dir/$archive_name"
8 changes: 2 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,8 @@ jobs:
- name: Build ${{ matrix.target }}
run: cargo build --release --target ${{ matrix.target }}
- name: Bundle ${{ matrix.target }}
uses: thedoctor0/[email protected]
with:
type: "${{contains(matrix.target, 'apple') && 'zip' || 'tar'}}"
directory: "target/${{ matrix.target }}/release/"
filename: "rusty-belt-${{github.ref_name}}-${{ matrix.target }}.${{ contains(matrix.target, 'apple') && 'zip' || 'tar.gz' }}"
exclusions: "./build ./deps ./examples ./incremental *.d *.rlib ./.fingerprint ./.cargo-lock"
run: ./.github/compress.sh "target/${{ matrix.target }}/release" "rusty-belt-${{ github.ref_name }}-${{ matrix.target }}"

publish-to-release:
runs-on: self-hosted
needs: build-and-bundle-binaries
Expand Down

0 comments on commit 73cd648

Please sign in to comment.