Files
OCCT/.github/actions/download-artifacts/action.yml
Pasukhin Dmitry 02f6fa7be2 Testing - Removed old test reference (#673)
Fixed regression when retests were failed for not windows.
2025-08-15 09:43:27 +01:00

72 lines
2.2 KiB
YAML

name: 'Download Platform Artifacts'
description: 'Download and extract artifacts with proper file permissions and symlinks (cross-platform)'
inputs:
name:
description: 'Artifact name'
required: true
path:
description: 'Path to extract to (optional)'
required: false
default: '.'
runs:
using: 'composite'
steps:
# For Windows, use standard GitHub action - no symlink issues
- name: Download artifacts (Windows)
if: runner.os == 'Windows'
uses: actions/download-artifact@v4.3.0
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
# For Linux/Unix, use custom workaround to handle symlinks properly
- name: Download archive (Unix)
if: runner.os != 'Windows'
uses: actions/download-artifact@v4.3.0
with:
name: ${{ inputs.name }}
path: ./download-temp
- name: Extract archive (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
EXTRACT_PATH="${{ inputs.path }}"
ARCHIVE_FILE="./download-temp/${{ inputs.name }}.tar.gz"
if [ ! -f "$ARCHIVE_FILE" ]; then
echo "Error: Archive file $ARCHIVE_FILE not found"
ls -la ./download-temp/
exit 1
fi
echo "Extracting $ARCHIVE_FILE to $EXTRACT_PATH"
# Extract and handle directory structure properly
if [ "$EXTRACT_PATH" != "." ]; then
# Extract to temp location first
mkdir -p temp-extract
tar -xzf "$ARCHIVE_FILE" -C temp-extract
# Create target directory and copy content (preserving existing files)
mkdir -p "$EXTRACT_PATH"
# Copy from install/ subdirectory if it exists, otherwise copy everything
if [ -d "temp-extract/install" ]; then
cp -r temp-extract/install/* "$EXTRACT_PATH/"
else
cp -r temp-extract/* "$EXTRACT_PATH/"
fi
# Clean up temp directory
rm -rf temp-extract
else
tar -xzf "$ARCHIVE_FILE" -C "$EXTRACT_PATH"
fi
echo "Extraction complete"
ls -la "$EXTRACT_PATH"
# Clean up temporary download directory
rm -rf ./download-temp