name: Aggregate Distro Update Sites on: workflow_call: inputs: version: description: Version suffix in S3 (i.e. 4.19.1.RELEASE) required: true type: string latest: description: Latest eclipse release version (i.e. e4.28) required: true type: string jobs: update-aggregate-update-sites: runs-on: ubuntu-latest outputs: invalid_urls: ${{ steps.gen-aggregate-sites.outputs.invalid_urls }} steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 with: sparse-checkout: | .github - name: Timestamp id: timestamp run: echo "date=`echo $(($(date +%s%N) / 1000000))`" >> $GITHUB_OUTPUT - name: Cloudgate S3 Configuration uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a with: aws-access-key-id: ${{ secrets.TOOLS_CLOUDGATE_ACCESS_KEY }} aws-secret-access-key: ${{ secrets.TOOLS_CLOUDGATE_SECRET_KEY }} role-to-assume: arn:aws:iam::${{ secrets.TOOLS_CLOUDGATE_ACCOUNT_ID }}:role/${{ secrets.TOOLS_CLOUDGATE_USER }} role-session-name: ${{ github.run_id }} aws-region: us-east-1 role-duration-seconds: 900 role-skip-session-tagging: true - name: Generate and Upload Aggregate Update Sites Data id: gen-aggregate-sites env: CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }} CLOUDFLARE_CACHE_TOKEN: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }} run: | echo "Akamai S3 Aggregate Update Sites Creation..." dirs=`aws s3 ls s3://tools-spring-io/release/TOOLS/sts4/update/${{ inputs.version }}/` pattern='^e[0-9]+.[0-9]+/$' invalid_urls="" for dir in $dirs do if [[ "$dir" =~ $pattern ]]; then echo "Found ${dir}" dir_name=${dir:0:-1} site_url="https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/${{ inputs.version }}/${dir_name}" ${{ github.workspace }}/.github/scripts/generate-composite-site-files.sh ${{ steps.timestamp.outputs.date }} $site_url cat ./compositeArtifacts.xml cat ./compositeContent.xml if [[ ${dir_name} == ${{ inputs.latest }} ]]; then aws s3 cp ./compositeArtifacts.xml s3://tools-spring-io/release/TOOLS/sts4/update/latest/ invalid_urls+="https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/latest/compositeArtifacts.xml " aws s3 cp ./compositeContent.xml s3://tools-spring-io/release/TOOLS/sts4/update/latest/ invalid_urls+="https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/latest/compositeContent.xml " aws s3 cp ./p2.index s3://tools-spring-io/release/TOOLS/sts4/update/latest/ invalid_urls+="https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/latest/p2.index " echo "TODO: Purge Cache" fi aws s3 mv ./compositeArtifacts.xml s3://tools-spring-io/release/TOOLS/sts4/update/${dir} invalid_urls+="https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/${dir_name}/compositeArtifacts.xml " aws s3 mv ./compositeContent.xml s3://tools-spring-io/release/TOOLS/sts4/update/${dir} invalid_urls+="https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/${dir_name}/compositeContent.xml " aws s3 mv ./p2.index s3://tools-spring-io/release/TOOLS/sts4/update/${dir} invalid_urls+="https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/${dir_name}/p2.index " fi done echo "invalid_urls=$invalid_urls" >> $GITHUB_OUTPUT purge_cache: needs: [ update-aggregate-update-sites ] runs-on: [self-hosted, macOS] steps: - uses: ./.github/actions/akamai-purge-osx name: Invalidate URLs env: EDGERC: ${{ secrets.EDGERC }} with: command: invalidate urls: ${{ needs.update-aggregate-update-sites.outputs.invalid_urls }}