From 73cd6486583f81f3ff68a8810e3530b0843599d4 Mon Sep 17 00:00:00 2001 From: Aleksandr Mikhailov Date: Thu, 28 Dec 2023 23:18:16 +0100 Subject: [PATCH] Use my own compression script --- .github/compress.sh | 23 +++++++++++++++++++++++ .github/workflows/release.yaml | 8 ++------ 2 files changed, 25 insertions(+), 6 deletions(-) create mode 100755 .github/compress.sh diff --git a/.github/compress.sh b/.github/compress.sh new file mode 100755 index 0000000..9420fe5 --- /dev/null +++ b/.github/compress.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +if [ "$#" -ne 2 ]; then + echo "Usage: $0 " + 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" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0a32421..b96feae 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -39,12 +39,8 @@ jobs: - name: Build ${{ matrix.target }} run: cargo build --release --target ${{ matrix.target }} - name: Bundle ${{ matrix.target }} - uses: thedoctor0/zip-release@0.7.5 - 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