Skip to content

Commit

Permalink
refactor: weired behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
aoudiamoncef authored Dec 15, 2023
1 parent 0990bba commit ae2728e
Showing 1 changed file with 11 additions and 27 deletions.
38 changes: 11 additions & 27 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,47 +92,31 @@ jobs:
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Uncompress all artifacts
- name: Extract artifacts
run: |
pwd && ls -al
# Define the temporary and release directories
tmp_dir="massa_tmp"
release_dir="massa_release"
# Create the temporary directory if it doesn't exist
mkdir -p "$tmp_dir"
mkdir -p "$release_dir"
# Move matching artifacts to the temporary directory
for file in massa_artifacts_*; do
mv "$file" "$tmp_dir/"
done
# Create the release directory if it doesn't exist
mkdir -p "$release_dir"
pwd && ls -al
cd "$tmp_dir" || exit 1
# Extract files from the temporary directory to the release directory
cd "$tmp_dir"
pwd && ls -al
for file in *; do
if [[ -f "$file" ]]; then # Check if it's a file
echo "Extracting $file..." # Display current file being processed
case "$file" in
*.zip)
unzip "$file" -d "../$release_dir/"
;;
*.tar.gz)
tar -xzf "$file" -C "../$release_dir/"
;;
*)
echo "Unsupported file format: $file"
;;
esac
if [[ -f "$file" ]]; then
echo "Extracting $file..."
if [[ "$file" == *".zip" ]]; then
unzip "$file" -d "../$release_dir/"
elif [[ "$file" == *".tar.gz" ]]; then
tar -xzf "$file" -C "../$release_dir/"
fi
fi
done
pwd && ls -al
# Move back to the original directory and remove the temporary directory
cd ..
rm -rf "$tmp_dir"
Expand Down

0 comments on commit ae2728e

Please sign in to comment.