From 98f00d4e338ca153800fb06126152b42a9392ab6 Mon Sep 17 00:00:00 2001 From: El Arbi Belfarsi Date: Mon, 15 Jul 2024 22:37:34 -0400 Subject: [PATCH] q --- .github/workflows/package-manifests.yml | 30 +++++++++++++++++-------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/package-manifests.yml b/.github/workflows/package-manifests.yml index 10b3cf96e90..75eb1726866 100644 --- a/.github/workflows/package-manifests.yml +++ b/.github/workflows/package-manifests.yml @@ -54,7 +54,13 @@ jobs: docker cp package-container:/app/output.json ${{ github.workspace }}/output.json aws s3 cp ${{ github.workspace }}/output.json s3://ebelfarsi-bucket/releases/output.json - - name: Prepare Directory Structure + - name: Download Build Assets + uses: actions/download-artifact@v2 + with: + name: build-assets # This should match the artifact name uploaded by build-assets.yml + path: ${{ github.workspace }}/build-assets + + - name: Prepare Directory Structure and Copy Real Files shell: bash run: | output_json_path="${{ github.workspace }}/output.json" @@ -66,21 +72,27 @@ jobs: # Create base directory if it doesn't exist mkdir -p "$base_dir" - # Parse JSON and create directory structure - jq -r '.[] | .Edge_Cast_Path' "$output_json_path" | while read path; do - full_path="${{ github.workspace }}/$path" + # Parse JSON and create directory structure with actual assets + jq -c '.[]' "$output_json_path" | while read -r item; do + edge_cast_path=$(echo "$item" | jq -r '.Edge_Cast_Path') + asset_name=$(basename "$edge_cast_path") + # Construct full path for the asset based on JSON + full_path="${base_dir}/${edge_cast_path}" mkdir -p "$(dirname "$full_path")" - touch "$full_path" + # Assuming asset files are directly under build-assets and match the names exactly as needed + if [ -f "${{ github.workspace }}/build-assets/${asset_name}" ]; then + cp "${{ github.workspace }}/build-assets/${asset_name}" "$full_path" + else + echo "Asset ${asset_name} not found, skipping..." + fi done - name: Sync Directory to S3 Bucket shell: bash run: | - output_json_path="${{ github.workspace }}/output.json" - version=$(jq -r '.[0].Version' "$output_json_path") - base_dir="${{ github.workspace }}/releases/CE-Candidate-${version}" aws s3 sync "$base_dir" s3://ebelfarsi-bucket/releases/CE-Candidate-${version} - + + - name: Upload output.json to GitHub Release uses: ncipollo/release-action@v1.14.0