From 29d7259563430435e76342fd9a85c6060a99de79 Mon Sep 17 00:00:00 2001 From: Paolo Gallina Date: Tue, 30 Jan 2024 11:45:44 +0100 Subject: [PATCH] feat(release): leveraging reusable workflow --- .github/workflows/on_release.yaml | 63 +++---------------------------- 1 file changed, 6 insertions(+), 57 deletions(-) diff --git a/.github/workflows/on_release.yaml b/.github/workflows/on_release.yaml index 7825448..a38ef1a 100644 --- a/.github/workflows/on_release.yaml +++ b/.github/workflows/on_release.yaml @@ -7,61 +7,10 @@ on: tags: - 'v*' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - INTEGRATION: "mssql" - ORIGINAL_REPO_NAME: ${{ github.event.repository.full_name }} - TAG: ${{ github.event.release.tag_name }} - jobs: - - publish-to-s3: - name: Send release assets to S3 - runs-on: ubuntu-latest - steps: - - name: Publish to S3 action - uses: newrelic/infrastructure-publish-action@v1 - env: - AWS_S3_BUCKET_NAME: "nr-downloads-main" - AWS_S3_LOCK_BUCKET_NAME: "onhost-ci-lock" - AWS_REGION: "us-east-1" - with: - # lock enabled - disable_lock: false - run_id: ${{ github.run_id }} - tag: ${{env.TAG}} - app_name: "nri-${{env.INTEGRATION}}" - repo_name: ${{ env.ORIGINAL_REPO_NAME }} - access_point_host: "production" - # 'ohi' is for integrations - schema: "ohi" - aws_region: ${{ env.AWS_REGION }} - aws_role_arn: ${{ secrets.OHAI_AWS_ROLE_ARN_PRODUCTION }} - aws_role_session_name: ${{ secrets.OHAI_AWS_ROLE_SESSION_NAME_PRODUCTION }} - aws_access_key_id: ${{ secrets.OHAI_AWS_ACCESS_KEY_ID_PRODUCTION }} - aws_secret_access_key: ${{ secrets.OHAI_AWS_SECRET_ACCESS_KEY_PRODUCTION }} - aws_s3_bucket_name: ${{ env.AWS_S3_BUCKET_NAME }} - # used for locking in case of concurrent releases - aws_s3_lock_bucket_name: ${{ env.AWS_S3_LOCK_BUCKET_NAME }} - # used for signing package stuff - gpg_passphrase: ${{ secrets.OHAI_GPG_PASSPHRASE }} - gpg_private_key_base64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} - - name: Test package from prod repo - uses: newrelic/integrations-pkg-test-action/linux@v1 - with: - tag: ${{ env.TAG }} - integration: 'nri-${{ env.INTEGRATION }}' # Required, with nri- prefix - packageLocation: repo - upgrade: false - - notify-failure: - if: ${{ always() && failure() }} - needs: [publish-to-s3] - runs-on: ubuntu-latest - steps: - - name: Notify failure via Slack - uses: archive/github-actions-slack@master - with: - slack-bot-user-oauth-access-token: ${{ secrets.COREINT_SLACK_TOKEN }} - slack-channel: ${{ secrets.COREINT_SLACK_CHANNEL }} - slack-text: "❌ `${{ env.ORIGINAL_REPO_NAME }}`: [release pipeline failed](${{ github.server_url }}/${{ env.ORIGINAL_REPO_NAME }}/actions/runs/${{ github.run_id }})." + release: + uses: newrelic/coreint-automation/.github/workflows/reusable_on_release.yaml@v2 + with: + integration: mssql + tag: ${{ github.event.release.tag_name }} + secrets: inherit