monitor-releases.yml 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. ---
  2. name: Monitor releases
  3. on:
  4. release:
  5. types: [released, deleted]
  6. workflow_dispatch:
  7. inputs:
  8. channel:
  9. description: 'Specify the release channel'
  10. required: true
  11. default: 'stable'
  12. concurrency:
  13. group: monitor-{{ github.event.inputs.channel }}-releases-${{ github.ref }}-${{ github.event_name }}
  14. cancel-in-progress: true
  15. jobs:
  16. update-agents-metadata:
  17. name: update-agents-metadata
  18. runs-on: ubuntu-latest
  19. steps:
  20. - name: Checkout
  21. id: checkout
  22. uses: actions/checkout@v4
  23. with:
  24. token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
  25. - name: Overwrite defaults
  26. id: ow-defaults
  27. run: |
  28. if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
  29. echo "RELEASE_CHANNEL=${{ github.event.inputs.channel }}" >> "${GITHUB_ENV}"
  30. else
  31. echo "RELEASE_CHANNEL=stable" >> "${GITHUB_ENV}"
  32. fi
  33. - name: Init Python environment
  34. uses: actions/setup-python@v5
  35. id: init-python
  36. with:
  37. python-version: "3.12"
  38. - name: Setup python environment
  39. id: setup-python
  40. run: |
  41. pip install -r .github/scripts/modules/requirements.txt
  42. - name: Check for newer versions
  43. id: check-newer-releases
  44. run: |
  45. python .github/scripts/check_latest_versions_per_channel.py "${{ env.RELEASE_CHANNEL }}"
  46. - name: SSH setup
  47. id: ssh-setup
  48. if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && steps.check-newer-releases.outputs.versions_needs_update == 'true'
  49. uses: shimataro/ssh-key-action@v2
  50. with:
  51. key: ${{ secrets.NETDATABOT_PACKAGES_SSH_KEY }}
  52. name: id_ecdsa
  53. known_hosts: ${{ secrets.PACKAGES_KNOWN_HOSTS }}
  54. - name: Sync newer releases to packages.netdata.cloud
  55. id: sync-releases
  56. continue-on-error: true
  57. if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && steps.check-newer-releases.outputs.versions_needs_update == 'true'
  58. run: |
  59. .github/scripts/upload-new-version-tags.sh packages.netdata.cloud
  60. - name: Sync newer releases to packages2.netdata.cloud
  61. id: sync-releases2
  62. if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && steps.check-newer-releases.outputs.versions_needs_update == 'true'
  63. run: |
  64. .github/scripts/upload-new-version-tags.sh packages2.netdata.cloud
  65. - name: Failure Notification
  66. uses: rtCamp/action-slack-notify@v2
  67. env:
  68. SLACK_COLOR: 'danger'
  69. SLACK_FOOTER: ''
  70. SLACK_ICON_EMOJI: ':github-actions:'
  71. SLACK_TITLE: 'Failed to prepare changelog:'
  72. SLACK_USERNAME: 'GitHub Actions'
  73. SLACK_MESSAGE: |-
  74. ${{ github.repository }}: Failed to update stable Agent's metadata.
  75. Checkout: ${{ steps.checkout.outcome }}
  76. Overwrite inputs: ${{ steps.ow-defaults.outcome }}
  77. Init python: ${{ steps.init-python.outcome }}
  78. Setup python: ${{ steps.setup-python.outcome }}
  79. Check for newer stable releaes: ${{ steps.check-newer-releases.outcome }}
  80. Setup ssh: ${{ steps.ssh-setup.outcome }}
  81. Syncing newer release to packages.netdata.cloud : ${{ steps.sync-releases.outcome }}
  82. Syncing newer release to packages2.netdata.cloud : ${{ steps.sync-releases2.outcome }}
  83. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  84. if: failure()