diff --git a/.github/workflows/package-manifests.yml b/.github/workflows/package-manifests.yml index 308bda9f4bd..8c473cb22bd 100644 --- a/.github/workflows/package-manifests.yml +++ b/.github/workflows/package-manifests.yml @@ -50,7 +50,6 @@ jobs: - name: Fetch Output from Container and Upload to S3 run: | 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 shell: bash @@ -58,27 +57,29 @@ jobs: output_json_path="${{ github.workspace }}/output.json" # Extract version number from the first entry - version=$(jq -r '.[0].Version' "$output_json_path") - base_dir="${{ github.workspace }}/releases/CE-Candidate-${version}" + version=$(jq -r '.[0].Version' "$output_json_path" | cut -d'-' -f1) + base_dir="${{ github.workspace }}/CE-Candidate-${version}" # 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" + full_path="$base_dir/$(echo $path | sed 's#releases/CE-Candidate-[^/]*##')" mkdir -p "$(dirname "$full_path")" touch "$full_path" done + # Rename and move output.json to manifests_versionnumber_meta_data.json in the base directory + mv "$output_json_path" "$base_dir/manifests_${version}_meta_data.json" + - 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/ - + version=$(jq -r '.[0].Version' ${{ github.workspace }}/output.json | cut -d'-' -f1) + base_dir="${{ github.workspace }}/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