monitor-releases.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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: # This keeps multiple instances of the job from running concurrently for the same ref and event type.
  13. group: monitor-{{ github.event.inputs.channel }}-releases-${{ github.ref }}-${{ github.event_name }}
  14. cancel-in-progress: true
  15. jobs:
  16. update-stable-agents-metadata:
  17. name: update-stable-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: Init python environment
  26. uses: actions/setup-python@v4
  27. id: init-python
  28. with:
  29. python-version: "3.12"
  30. - name: Setup python environment
  31. id: setup-python
  32. run: |
  33. pip install -r .github/scripts/modules/requirements.txt
  34. - name: Check for newer versions
  35. id: check-newer-releases
  36. run: |
  37. python .github/scripts/check_latest_versions_per_channel.py "${{ github.event.inputs.channel }}"
  38. - name: SSH setup
  39. id: ssh-setup
  40. if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && steps.check-newer-releases.outputs.versions_needs_update == 'true'
  41. uses: shimataro/ssh-key-action@v2
  42. with:
  43. key: ${{ secrets.NETDATABOT_PACKAGES_SSH_KEY }}
  44. name: id_ecdsa
  45. known_hosts: ${{ secrets.PACKAGES_KNOWN_HOSTS }}
  46. - name: Sync newer releases
  47. id: sync-releases
  48. if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && steps.check-newer-releases.outputs.versions_needs_update == 'true'
  49. run: |
  50. .github/scripts/upload-new-version-tags.sh
  51. - name: Failure Notification
  52. uses: rtCamp/action-slack-notify@v2
  53. env:
  54. SLACK_COLOR: 'danger'
  55. SLACK_FOOTER: ''
  56. SLACK_ICON_EMOJI: ':github-actions:'
  57. SLACK_TITLE: 'Failed to prepare changelog:'
  58. SLACK_USERNAME: 'GitHub Actions'
  59. SLACK_MESSAGE: |-
  60. ${{ github.repository }}: Failed to update stable Agent's metadata.
  61. Checkout: ${{ steps.checkout.outcome }}
  62. Init python: ${{ steps.init-python.outcome }}
  63. Setup python: ${{ steps.setup-python.outcome }}
  64. Check for newer stable releaes: ${{ steps.check-newer-releases.outcome }}
  65. Setup ssh: ${{ steps.ssh-setup.outcome }}
  66. Syncing newer release to packages.netdata.cloud : ${{ steps.sync-releases.outcome }}
  67. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  68. if: failure()