66 lines
3.0 KiB
YAML
66 lines
3.0 KiB
YAML
name: Aggregate LS Extensions Update Sites
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
version:
|
|
description: The suffix of the p2 repo URL in S3 (i.e. 2023-08-01)
|
|
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..."
|
|
invalid_urls=""
|
|
site_url="https://cdn.spring.io/spring-tools/release/TOOLS/sts4-language-server-integrations/${{ inputs.version }}"
|
|
${{ github.workspace }}/.github/scripts/generate-composite-site-files.sh ${{ steps.timestamp.outputs.date }} $site_url
|
|
cat ./compositeArtifacts.xml
|
|
cat ./compositeContent.xml
|
|
aws s3 cp ./compositeArtifacts.xml s3://tools-spring-io/release/TOOLS/sts4-language-server-integrations/
|
|
invalid_urls+="https://cdn.spring.io/spring-tools/release/TOOLS/sts4-language-server-integrations/compositeArtifacts.xml "
|
|
aws s3 cp ./compositeContent.xml s3://tools-spring-io/release/TOOLS/sts4-language-server-integrations/
|
|
invalid_urls+="https://cdn.spring.io/spring-tools/release/TOOLS/sts4-language-server-integrations/compositeContent.xml "
|
|
aws s3 cp ./p2.index s3://tools-spring-io/release/TOOLS/sts4-language-server-integrations/
|
|
invalid_urls+="https://cdn.spring.io/spring-tools/release/TOOLS/sts4-language-server-integrations/p2.index"
|
|
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 }}
|