Skip to content

Commit

Permalink
q
Browse files Browse the repository at this point in the history
  • Loading branch information
ebelfarsi committed Jul 16, 2024
1 parent f3cac45 commit 98f00d4
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions .github/workflows/package-manifests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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/[email protected]
Expand Down

0 comments on commit 98f00d4

Please sign in to comment.