Files
spring-tools/.github/workflows/update-aggregate-update-sites.yml
2023-08-02 11:04:06 -04:00

57 lines
2.7 KiB
YAML

name: Update Aggregate Update Sites
on:
workflow_dispatch:
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
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
sparse-checkout: |
.github
- name: Timestamp
id: timestamp
run: echo "date=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
- name: Generate and Upload Aggregate Update Sites Data
env:
AWS_ACCESS_KEY_ID: ${{ secrets.TOOLS_S3_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.TOOLS_S3_SECRET_KEY }}
AWS_DEFAULT_REGION: us-east-1
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}
CLOUDFLARE_CACHE_TOKEN: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }}
run: |
dirs=`aws s3 ls s3://dist.springsource.com/release/TOOLS/sts4/update/${{ inputs.version }}/`
pattern='^e[0-9]+.[0-9]+/$'
for dir in $dirs
do
if [[ "$dir" =~ $pattern ]]; then
echo "Found ${dir}"
dir_name=${dir:0:-1}
site_url="https://download.springsource.com/release/TOOLS/sts4/update/${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
echo "aws s3 cp ./compositeArtifacts.xml s3://dist.springsource.com/release/TOOLS/sts4/update/latest --dryrun --acl public-read"
echo "aws s3 cp ./compositeContent.xml s3://dist.springsource.com/release/TOOLS/sts4/update/latest --dryrun --acl public-read"
echo "aws s3 cp ./p2.index s3://dist.springsource.com/release/TOOLS/sts4/update/latest --dryrun --acl public-read"
echo "Clear caches for path release/TOOLS/sts4/update/latest"
fi
echo "aws s3 mv ./compositeArtifacts.xml s3://dist.springsource.com/release/TOOLS/sts4/update/${dir} --dryrun --acl public-read"
echo "aws s3 mv ./compositeContent.xml s3://dist.springsource.com/release/TOOLS/sts4/update/${dir} --dryrun --acl public-read"
echo "aws s3 mv ./p2.index s3://dist.springsource.com/release/TOOLS/sts4/update/${dir} --dryrun --acl public-read"
echo "Clear caches for path release/TOOLS/sts4/update/${dir_name}"
fi
done