Skip to content

Commit

Permalink
Flush CDN after uploading artifacts and cleanup old DEV cocoapods. (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaliyf authored Jul 23, 2024
1 parent cd109e5 commit e986e10
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/create-release-candidate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,19 @@ jobs:
# missing dsysm upload
- name: Flush CloudFront CDN
env:
# downloads.stg.emb-eng.com
AWS_CLOUDFRONT_ID: E1Q329634TJ1Q9
run: |
echo "$(date): Invalidating https://us-east-1.console.aws.amazon.com/cloudfront/v3/home?region=us-west-2#/distributions/${{ env.AWS_CLOUDFRONT_ID }}"
aws cloudfront create-invalidation --region us-west-2 --distribution-id ${{ env.AWS_CLOUDFRONT_ID }} --paths '/*' | tee invalidation.json
invalidation_id=$(cat invalidation.json | jq -r .Invalidation.Id)
echo "$(date): Waiting for completion of https://us-east-1.console.aws.amazon.com/cloudfront/v3/home?region=us-west-2#/distributions/${{ env.AWS_CLOUDFRONT_ID }}/invalidations/details/${invalidation_id}"
aws cloudfront wait invalidation-completed --region us-west-2 --distribution-id ${{ env.AWS_CLOUDFRONT_ID }} --id $invalidation_id
push_podspec:
name: Push Podspec to Cocoapods
runs-on: macos-13
Expand Down Expand Up @@ -274,6 +287,16 @@ jobs:
- name: Push EmbraceIO-DEV Podspec
run: |
pod trunk push embrace-apple-core-internal/EmbraceIO-DEV.podspec --allow-warnings
- name: Cleanup old EmbraceIO-DEV Cocoapods versions
env:
KEEP_VERSIONS: 5
run: |
brew install coreutils # Install sane version of "head"
for old_version in $(pod trunk info EmbraceIO-DEV | grep '^ -' | grep ' (20' | ghead -n -${KEEP_VERSIONS} | awk '{print $2}'); do
echo "Removing $old_version"
echo "y" | pod trunk delete EmbraceIO-DEV $old_version || echo "We can ignore any errors"
done
# Note: missing/removed steps from old sdk
# - Store embrace-apple-sdk.json
Expand Down

0 comments on commit e986e10

Please sign in to comment.