@@ -43,18 +43,32 @@ jobs:
4343 - name : Configure AWS Credentials
4444 uses : aws-actions/configure-aws-credentials@v1
4545 with :
46- aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
47- aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
46+ aws-access-key-id : ${{ secrets.AWS_STAGING_ACCESS_KEY_ID }}
47+ aws-secret-access-key : ${{ secrets.AWS_STAGING_SECRET_ACCESS_KEY }}
4848 aws-region : us-west-2
4949
5050 # This step uses the upload-artifact Github action: https://github.com/actions/upload-artifact
5151 - name : Upload Artifacts to S3
5252 run : |
53- s3_path=s3://artifacts.opendistroforelasticsearch.amazon.com/downloads
54- aws s3 cp index-management-artifacts/*.zip $s3_path/elasticsearch-plugins/opendistro-index-management/
55- aws s3 cp index-management-artifacts/*.deb $s3_path/debs/opendistro-index-management/
56- aws s3 cp index-management-artifacts/*.rpm $s3_path/rpms/opendistro-index-management/
57- aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths '/downloads/*'
53+ zip=`ls index-management-artifacts/*.zip`
54+ rpm=`ls index-management-artifacts/*.rpm`
55+ deb=`ls index-management-artifacts/*.deb`
56+
57+ # Inject the build number before the suffix
58+ zip_outfile=`basename ${zip%.zip}-build-${GITHUB_RUN_NUMBER}.zip`
59+ rpm_outfile=`basename ${rpm%.rpm}-build-${GITHUB_RUN_NUMBER}.rpm`
60+ deb_outfile=`basename ${deb%.deb}-build-${GITHUB_RUN_NUMBER}.deb`
61+
62+ s3_prefix="s3://staging.artifacts.opendistroforelasticsearch.amazon.com/snapshots/elasticsearch-plugins/index-management/"
63+
64+ echo "Copying ${zip} to ${s3_prefix}${zip_outfile}"
65+ aws s3 cp --quiet $zip ${s3_prefix}${zip_outfile}
66+
67+ echo "Copying ${rpm} to ${s3_prefix}${rpm_outfile}"
68+ aws s3 cp --quiet $rpm ${s3_prefix}${rpm_outfile}
69+
70+ echo "Copying ${deb} to ${s3_prefix}${deb_outfile}"
71+ aws s3 cp --quiet $deb ${s3_prefix}${deb_outfile}
5872
5973 - name : Create Github Draft Release
6074 id : create_release
0 commit comments