From d1b59295a59c8110087cc70deaadfd32ac78c41c Mon Sep 17 00:00:00 2001 From: aboyko Date: Fri, 21 Jul 2023 13:54:58 -0400 Subject: [PATCH] GHA: convert download page update to a reusable shell script --- .../scripts/update-distro-download-page.sh | 19 ++++++++++ .../gh-hosted-eclipse-distro-build.yml | 37 +++++++++++-------- 2 files changed, 41 insertions(+), 15 deletions(-) create mode 100755 .github/scripts/update-distro-download-page.sh diff --git a/.github/scripts/update-distro-download-page.sh b/.github/scripts/update-distro-download-page.sh new file mode 100755 index 000000000..7175c4ccb --- /dev/null +++ b/.github/scripts/update-distro-download-page.sh @@ -0,0 +1,19 @@ +dist_path=$1 +eclipse_version=$2 +build_type=$3 + +s3_url=s3://dist.springsource.com/${dist_path} +downloads_html="sts4-nightly-${eclipse_version}.html" +files=`aws s3 cp ${s3_url} . --recursive --exclude "*" --include "spring-tool-suite-4*.zip" --include "spring-tool-suite-4*.dmg" --include "spring-tool-suite-4*.self-extracting.jar" --include "spring-tool-suite-4*.tar.gz" --exclude "*/*" --dryrun` +echo '' >> $downloads_html +cat ./$downloads_html +aws s3 mv ./$downloads_html s3://dist.springsource.com/${build_type}/STS4/ --acl public-read --no-progress diff --git a/.github/workflows/gh-hosted-eclipse-distro-build.yml b/.github/workflows/gh-hosted-eclipse-distro-build.yml index 3224ea1eb..5da520245 100644 --- a/.github/workflows/gh-hosted-eclipse-distro-build.yml +++ b/.github/workflows/gh-hosted-eclipse-distro-build.yml @@ -236,6 +236,10 @@ jobs: AWS_DEFAULT_REGION: us-east-1 run: | aws s3 rm s3://dist.springsource.com/sts4-distro-ci-temp --recursive --exclude "*" --include "${{ github.run_id }}/*" + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + with: + sparse-checkout: | + .github - uses: actions/download-artifact@cbed621e49e4c01b044d60f6c80ea4ed6328b281 with: name: s3-dist-path-${{ github.run_id }}.${{ github.run_attempt }} @@ -247,20 +251,23 @@ jobs: AWS_DEFAULT_REGION: us-east-1 run: | dist_path=`cat s3-dist-path.txt` - s3_url=s3://dist.springsource.com/${dist_path} eclipse_profile=${{ inputs.eclipse_profile }} eclipse_version=${eclipse_profile:0:2}.${eclipse_profile:2} - downloads_html="sts4-nightly-${eclipse_version}.html" - files=`aws s3 cp ${s3_url} . --recursive --exclude "*" --include "spring-tool-suite-4*.zip" --include "spring-tool-suite-4*.dmg" --include "spring-tool-suite-4*.self-extracting.jar" --include "spring-tool-suite-4*.tar.gz" --exclude "*/*" --dryrun` - echo '' >> $downloads_html - cat ./$downloads_html - aws s3 mv ./$downloads_html s3://dist.springsource.com/${{ inputs.build_type }}/STS4/ --acl public-read --no-progress + ${{ github.workspace }}/.github/scripts/update-distro-download-page.sh $dist_path $eclipse_version ${{ inputs.build_type }} +# s3_url=s3://dist.springsource.com/${dist_path} +# eclipse_profile=${{ inputs.eclipse_profile }} +# eclipse_version=${eclipse_profile:0:2}.${eclipse_profile:2} +# downloads_html="sts4-nightly-${eclipse_version}.html" +# files=`aws s3 cp ${s3_url} . --recursive --exclude "*" --include "spring-tool-suite-4*.zip" --include "spring-tool-suite-4*.dmg" --include "spring-tool-suite-4*.self-extracting.jar" --include "spring-tool-suite-4*.tar.gz" --exclude "*/*" --dryrun` +# echo '' >> $downloads_html +# cat ./$downloads_html +# aws s3 mv ./$downloads_html s3://dist.springsource.com/${{ inputs.build_type }}/STS4/ --acl public-read --no-progress