Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Change release workflow to use new staging bucket for artifacts (#84)
Browse files Browse the repository at this point in the history
* Change release workflow to use new staging bucket for artifacts
  • Loading branch information
gaiksaya authored Feb 1, 2021
1 parent 88ff307 commit 1bb58d9
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,33 @@ jobs:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-access-key-id: ${{ secrets.AWS_STAGING_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_STAGING_SECRET_ACCESS_KEY }}
aws-region: us-west-2

# This step uses the upload-artifact Github action: https://github.com/actions/upload-artifact
- name: Upload Artifacts to S3
shell: bash
run: |
s3_path=s3://artifacts.opendistroforelasticsearch.amazon.com/downloads
aws s3 cp job-scheduler-artifacts/*.zip $s3_path/elasticsearch-plugins/opendistro-job-scheduler/
aws s3 cp job-scheduler-artifacts/*.deb $s3_path/debs/opendistro-job-scheduler/
aws s3 cp job-scheduler-artifacts/*.rpm $s3_path/rpms/opendistro-job-scheduler/
aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths '/downloads/*'
zip=`ls build/distributions/*.zip`
rpm=`ls build/distributions/*.rpm`
deb=`ls build/distributions/*.deb`
# Inject the build number before the suffix
zip_outfile=`basename ${zip%.zip}-build-${GITHUB_RUN_NUMBER}.zip`
rpm_outfile=`basename ${rpm%.rpm}-build-${GITHUB_RUN_NUMBER}.rpm`
deb_outfile=`basename ${deb%.deb}-build-${GITHUB_RUN_NUMBER}.deb`
s3_prefix="s3://staging.artifacts.opendistroforelasticsearch.amazon.com/snapshots/elasticsearch-plugins/job-scheduler/"
echo "Copying ${zip} to ${s3_prefix}${zip_outfile}"
aws s3 cp --quiet $zip ${s3_prefix}${zip_outfile}
echo "Copying ${rpm} to ${s3_prefix}${rpm_outfile}"
aws s3 cp --quiet $rpm ${s3_prefix}${rpm_outfile}
echo "Copying ${deb} to ${s3_prefix}${deb_outfile}"
aws s3 cp --quiet $deb ${s3_prefix}${deb_outfile}
# Creating release draft
- name: Create Github Draft Release
Expand Down

0 comments on commit 1bb58d9

Please sign in to comment.