diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index cc7d69d13c..d9d3dfad3f 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -92,41 +92,41 @@ jobs: steps: - name: Download all artifacts uses: actions/download-artifact@v4 + with: + path: artifacts - name: Extract artifacts run: | - tmp_dir="massa_tmp" - release_dir="massa_release" - - mkdir -p "$tmp_dir" - mkdir -p "$release_dir" - - for file in massa_artifacts_*; do - mv "$file" "$tmp_dir/" - done - - cd "$tmp_dir" || exit 1 - - for file in *; do - 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/" + source_directory="artifacts" + tmp_directory="tmp" + release_directory="release" + + mkdir -p "$tmp_directory" + mkdir -p "$release_directory" + + for file in "$source_directory"/*.{zip,gz}; do + if [ -f "$file" ]; then + mv "$file" "$tmp_directory" + cd "$tmp_directory" || exit + if [[ "$file" == *.zip ]]; then + unzip -q "$(basename "$file")" -d "$release_directory" + rm "$(basename "$file")" + echo "Extracted $(basename "$file") to $release_directory" + elif [[ "$file" == *.gz ]]; then + gzip -d "$(basename "$file")" + echo "Extracted $(basename "$file") in $tmp_directory" fi fi done - - cd .. - rm -rf "$tmp_dir" + + rm -rf "$tmp_directory" - name: Generate checksums file uses: jmgilman/actions-generate-checksum@v1 with: method: sha256 patterns: | - massa_release/massa_*.zip - massa_release/massa_*.tar.gz + release/massa_*.zip + release/massa_*.tar.gz output: checksums.txt - name: Publish checksums file uses: softprops/action-gh-release@v1