From cc871058cfae33ee3146b2b19e738159e89a8658 Mon Sep 17 00:00:00 2001 From: Mohammad Qureshi <47198598+qreshi@users.noreply.github.com> Date: Fri, 10 Dec 2021 16:19:11 -0800 Subject: [PATCH] Update GitHub Actions to run on all branches (#256) Signed-off-by: Mohammad Qureshi --- .../workflows/multi-node-test-workflow.yml | 4 +- .github/workflows/release-workflow.yml | 122 ------------------ .github/workflows/test-workflow.yml | 6 +- 3 files changed, 4 insertions(+), 128 deletions(-) delete mode 100644 .github/workflows/release-workflow.yml diff --git a/.github/workflows/multi-node-test-workflow.yml b/.github/workflows/multi-node-test-workflow.yml index c8a7f270f..8bc9d598b 100644 --- a/.github/workflows/multi-node-test-workflow.yml +++ b/.github/workflows/multi-node-test-workflow.yml @@ -3,10 +3,10 @@ name: Multi node test workflow on: pull_request: branches: - - main + - "*" push: branches: - - main + - "*" jobs: build: diff --git a/.github/workflows/release-workflow.yml b/.github/workflows/release-workflow.yml deleted file mode 100644 index f29d78b6c..000000000 --- a/.github/workflows/release-workflow.yml +++ /dev/null @@ -1,122 +0,0 @@ -name: Release workflow -# This workflow is triggered on creating tags to main or a opendistro release branch -on: - push: - tags: - - 'v*' - -jobs: - build: - strategy: - matrix: - java: [14] - # Job name - name: Build Alerting with JDK ${{ matrix.java }} - # This job runs on Linux - runs-on: ubuntu-latest - steps: - # This step uses the checkout Github action: https://github.com/actions/checkout - - name: Checkout Branch - uses: actions/checkout@v2 - # This step uses the setup-java Github action: https://github.com/actions/setup-java - - name: Set Up JDK ${{ matrix.java }} - uses: actions/setup-java@v1 - with: - java-version: ${{ matrix.java }} - - # Building zip, deb and rpm files - - name: Build with Gradle - run: ./gradlew build buildDeb buildRpm --no-daemon -Dbuild.snapshot=false - - # Creating artifact path as well as individual folders for rpm, zip and deb assets - - name: Create Artifact Path - run: | - mkdir -p alerting-artifacts - cp alerting/build/distributions/*.zip alerting-artifacts - cp alerting/build/distributions/*.zip alerting-artifacts_zip - cp alerting/build/distributions/*.deb alerting-artifacts - cp alerting/build/distributions/*.deb alerting-artifacts_deb - cp alerting/build/distributions/*.rpm alerting-artifacts - cp alerting/build/distributions/*.rpm alerting-artifacts_rpm - echo "TAG_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV - - # AWS authentication - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - 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 - run: | - zip=`ls alerting-artifacts/*.zip` - rpm=`ls alerting-artifacts/*.rpm` - deb=`ls alerting-artifacts/*.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/alerting/" - - 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} - - - name: Create Github Draft Release - id: create_release - uses: actions/create-release@v1.0.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ env.TAG_VERSION }} - draft: true - prerelease: false - - # Upload the release with .zip as asset - - name: Upload Release Asset - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_name: alerting.zip - asset_path: alerting-artifacts_zip - asset_content_type: application/zip - - # Upload the release with .rpm as asset - - name: Upload Release Asset - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_name: alerting.rpm - asset_path: alerting-artifacts_rpm - asset_content_type: application/zip - - # Upload the release with .deb as asset - - name: Upload Release Asset - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_name: alerting.deb - asset_path: alerting-artifacts_deb - asset_content_type: application/zip - - - name: Upload Workflow Artifacts - uses: actions/upload-artifact@v1 - with: - name: alerting-plugin - path: alerting-artifacts diff --git a/.github/workflows/test-workflow.yml b/.github/workflows/test-workflow.yml index 53897139b..7c6a82966 100644 --- a/.github/workflows/test-workflow.yml +++ b/.github/workflows/test-workflow.yml @@ -3,12 +3,10 @@ name: Test Workflow on: pull_request: branches: - - main - - opendistro-* + - "*" push: branches: - - main - - opendistro-* + - "*" jobs: build: