-
Notifications
You must be signed in to change notification settings - Fork 209
54 lines (50 loc) · 2.43 KB
/
aggregate-ls-extensions-update-site.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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
env:
AWS_ACCESS_KEY_ID: ${{ secrets.CDN_S3_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CDN_S3_SECRET_KEY }}
AWS_DEFAULT_REGION: us-east-1
AWS_ENDPOINT_URL_S3: ${{ secrets.CDN_S3_ENDPOINT }}
AWS_S3_BUCKET: ${{ secrets.CDN_BUCKET }}/spring-tools
DOWNLOAD_URL_ROOT: https://cdn.spring.io/spring-tools
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: Generate and Upload Aggregate Update Sites Data
id: gen-aggregate-sites
run: |
echo "S3 Aggregate Update Sites Creation..."
invalid_urls=""
site_url="${DOWNLOAD_URL_ROOT}/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://$AWS_S3_BUCKET/release/TOOLS/sts4-language-server-integrations/
invalid_urls+="${DOWNLOAD_URL_ROOT}/release/TOOLS/sts4-language-server-integrations/compositeArtifacts.xml "
aws s3 cp ./compositeContent.xml s3://$AWS_S3_BUCKET/release/TOOLS/sts4-language-server-integrations/
invalid_urls+="${DOWNLOAD_URL_ROOT}/release/TOOLS/sts4-language-server-integrations/compositeContent.xml "
aws s3 cp ./p2.index s3://$AWS_S3_BUCKET/release/TOOLS/sts4-language-server-integrations/
invalid_urls+="${DOWNLOAD_URL_ROOT}/release/TOOLS/sts4-language-server-integrations/p2.index"
echo "invalid_urls=$invalid_urls" >> $GITHUB_OUTPUT
- uses: ./.github/actions/cloudflare-purge
name: Invalidate URLs
with:
urls: ${{ steps.gen-aggregate-sites.outputs.invalid_urls }}
cloudflare_zone_id: ${{ secrets.CLOUDFLARE_ZONE_ID }}
cloudflare_cache_token: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }}