Skip to content

Commit

Permalink
publish_windows
Browse files Browse the repository at this point in the history
  • Loading branch information
luckslovez committed Mar 5, 2024
1 parent ed20067 commit de1aade
Show file tree
Hide file tree
Showing 22 changed files with 104 additions and 104 deletions.
208 changes: 104 additions & 104 deletions .github/workflows/merge_to_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,114 +3,114 @@ name: Merge to main
on:
push:
branches:
- main
- enable-windows

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 ]
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
# 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
# uses: ./.github/workflows/run_task.yml
# 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 ]
# name: Run E2E tests for all supported packages installing NRIA from production
# uses: ./.github/workflows/run_e2e_tests.yml
# with:
# container_make_target: "ansible/upload-win-packages PR_TAG=${{ needs.get_release_tag.outputs.tag }}"
# 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

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
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
uses: actions/github-script@v6
with:
script: |
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
echo "Promoting pre_release to release"
gh release edit $TAG --draft=false --prerelease=false --title "Release $PR_NUMBER"
fi
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=tmp-pr-110"
secrets: inherit

notify:
runs-on: ubuntu-latest
needs: [ get_release_tag, promote_prerelease_to_release ]
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
# 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
# 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
# uses: actions/github-script@v6
# with:
# script: |
# 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
# echo "Promoting pre_release to release"
# gh release edit $TAG --draft=false --prerelease=false --title "Release $PR_NUMBER"
# fi
#
# notify:
# runs-on: ubuntu-latest
# needs: [ get_release_tag, promote_prerelease_to_release ]
# 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit de1aade

Please sign in to comment.