Upgrade fluent bit version to 3.2.2 to amazonlinux packages only (#187) #42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Merge to main | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
get_release_tag: | |
name: Gets pre-release tag commit associated with the merged PR | |
runs-on: ubuntu-latest | |
outputs: | |
tag: "tmp-pr-${{ steps.get_pr_number.outputs.result }}" | |
pr_number: "${{ steps.get_pr_number.outputs.result }}" | |
steps: | |
- name: Get PR number | |
uses: actions/github-script@v6 | |
id: get_pr_number | |
with: | |
script: | | |
return ( | |
await github.rest.repos.listPullRequestsAssociatedWithCommit({ | |
commit_sha: context.sha, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
}) | |
).data[0].number; | |
result-encoding: string | |
publish_linux_to_prod: | |
name: Publish linux packages to production | |
needs: get_release_tag | |
runs-on: ubuntu-latest | |
steps: | |
- name: Publish linux packages to production | |
uses: newrelic/infrastructure-publish-action@v1 | |
with: | |
app_name: fluent-bit | |
tag: ${{ needs.get_release_tag.outputs.tag }} | |
repo_name: "newrelic/fluent-bit-package" | |
schema: "custom" | |
schema_url: "https://github.com/newrelic/fluent-bit-package/releases/download/${{ needs.get_release_tag.outputs.tag }}/generated-linux-schema-production.yaml" | |
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: "nr-downloads-main" | |
aws_s3_lock_bucket_name: "onhost-ci-lock" | |
access_point_host: "production" | |
run_id: ${{ github.run_id }} | |
aws_region: "us-east-1" | |
aws_role_session_name: ${{ secrets.OHAI_AWS_ROLE_SESSION_NAME_PRODUCTION }} | |
aws_role_arn: ${{ secrets.OHAI_AWS_ROLE_ARN_PRODUCTION }} | |
# used for signing package stuff | |
gpg_passphrase: ${{ secrets.OHAI_GPG_PASSPHRASE }} | |
gpg_private_key_base64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} # base64 encoded | |
run_e2e_tests_production: | |
needs: [ get_release_tag, publish_linux_to_prod ] | |
if: | | |
always() && !failure() && !cancelled() | |
name: Run E2E tests for all supported packages installing NRIA from production | |
uses: ./.github/workflows/run_e2e_tests.yml | |
with: | |
gh_release_name: ${{ needs.get_release_tag.outputs.tag }} | |
infra_agent_version: latest | |
infra_agent_env: production | |
test_report_filename: test-report-production.xml | |
secrets: inherit | |
publish_windows: | |
name: Publish windows packages to logging's production bucket | |
needs: get_release_tag | |
uses: ./.github/workflows/run_task.yml | |
with: | |
container_make_target: "ansible/upload-win-packages/run PR_TAG=${{ needs.get_release_tag.outputs.tag }}" | |
secrets: inherit | |
promote_prerelease_to_release: | |
name: If there are packages in the pre_release, promote it to release | |
needs: [ get_release_tag, run_e2e_tests_production ] | |
runs-on: ubuntu-latest | |
outputs: | |
is_release: "${{ steps.promote_to_release.outputs.is_release }}" | |
env: | |
GH_TOKEN: ${{ github.token }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Check if pre_release has artifacts, if so, upgrade to release | |
id: promote_to_release | |
run: | | |
PR_NUMBER=${{ needs.get_release_tag.outputs.pr_number }} | |
TAG=${{ needs.get_release_tag.outputs.tag }} | |
PKG_COUNT=$(gh release view $TAG --repo newrelic/fluent-bit-package --json assets --jq '.assets[].name' | grep -E '^(fb-windows|fluent-bit)' | wc -l) | |
if [[ $PKG_COUNT -gt 0 ]] | |
then | |
gh release edit $TAG --draft=false --prerelease=false --title "Release $PR_NUMBER" | |
echo "is_release=true" >> $GITHUB_OUTPUT | |
fi | |
notify: | |
runs-on: ubuntu-latest | |
needs: [ get_release_tag, promote_prerelease_to_release ] | |
if: ${{ needs.promote_prerelease_to_release.outputs.is_release == 'true' }} | |
steps: | |
- name: Send release details to Slack workflow | |
id: slack | |
uses: slackapi/slack-github-action@v1 | |
with: | |
payload: | | |
{ | |
"releaseUrl": "https://github.com/newrelic/fluent-bit-package/releases/tag/${{ needs.get_release_tag.outputs.tag }}", | |
"releaseName": "${{ needs.get_release_tag.outputs.tag }}", | |
"productName": "${{ env.PRODUCT_NAME }}", | |
"productUrl": "${{ env.PRODUCT_URL }}" | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
PRODUCT_NAME: Fluent Bit packages for the New Relic Infrastructure Agent | |
PRODUCT_URL: https://docs.newrelic.com/docs/logs/forward-logs/forward-your-logs-using-infrastructure-agent |