Skip to content

Commit

Permalink
windows_publish + auto release(#114)
Browse files Browse the repository at this point in the history
- Windows publishing
  - Use server side encryption when putting objects to s3
- Release promotion
  - Use simple script to determine whether a pre_release needs to promote to release
  • Loading branch information
luckslovez authored Mar 5, 2024
1 parent ed20067 commit bd35cb1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/merge_to_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ jobs:

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:
Expand All @@ -64,13 +66,13 @@ jobs:
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 PR_TAG=${{ needs.get_release_tag.outputs.tag }}"
# 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
Expand All @@ -83,17 +85,15 @@ jobs:
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
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
echo "Promoting pre_release to release"
gh release edit $TAG --draft=false --prerelease=false --title "Release $PR_NUMBER"
fi
notify:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ jobs:
download_official_packages:
needs: [setup_environment]
runs-on: ubuntu-latest
if: ${{ needs.setup_environment.outputs.linux_and_windows_matrix != '[]' }}
strategy:
fail-fast: true
matrix:
Expand Down Expand Up @@ -142,6 +143,7 @@ jobs:

spin_up_suse:
needs: setup_environment
if: ${{ needs.setup_environment.outputs.sles_matrix != '[]' }}
uses: ./.github/workflows/run_task.yml
with:
container_make_target: "terraform/ec2-suse-builders/provision PRE_RELEASE_NAME=${{ needs.setup_environment.outputs.pre_release_name }}"
Expand All @@ -164,6 +166,7 @@ jobs:
sign_suse_packages:
needs: [setup_environment, build_suse_packages]
runs-on: ubuntu-latest
if: ${{ needs.setup_environment.outputs.sles_matrix != '[]' }}
strategy:
fail-fast: true
matrix:
Expand Down Expand Up @@ -228,6 +231,8 @@ jobs:

run_e2e_tests_staging:
needs: [ setup_environment, run_e2e_tests_prerelease, publish_linux_to_staging ]
if: |
always() && !failure() && !cancelled()
name: Run E2E tests for all supported packages installing NRIA+FB from staging
uses: ./.github/workflows/run_e2e_tests.yml
with:
Expand Down
2 changes: 1 addition & 1 deletion ansible/upload-win-packages/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
loop: "{{ windows_artifacts }}"

- name: Upload windows artifacts
ansible.builtin.command: "aws s3 cp {{ item }} s3://{{ windows_bucket }}/"
ansible.builtin.command: "aws s3 cp {{ item }} s3://{{ windows_bucket }}/ --sse AES256"
loop: "{{ windows_artifacts }}"

0 comments on commit bd35cb1

Please sign in to comment.