monitor-releases.yml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. if: ${{ github.ref == 'refs/heads/master' }}
  19. runs-on: ubuntu-latest
  20. steps:
  21. - name: Checkout
  22. id: checkout
  23. uses: actions/checkout@v4
  24. with:
  25. token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
  26. - name: Init python environment
  27. uses: actions/setup-python@v4
  28. id: init-python
  29. with:
  30. python-version: "3.12"
  31. - name: Setup python environment
  32. id: setup-python
  33. run: |
  34. pip install -r .github/scripts/modules/requirements.txt
  35. - name: Check for newer versions
  36. id: check-newer-releases
  37. run: |
  38. python .github/scripts/check_latest_versions_per_channel.py "${{ github.event.inputs.channel }}"
  39. - name: SSH setup
  40. id: ssh-setup
  41. if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && steps.check-newer-releases.outputs.versions_needs_update == 'true'
  42. uses: shimataro/ssh-key-action@v2
  43. with:
  44. key: ${{ secrets.NETDATABOT_PACKAGES_SSH_KEY }}
  45. name: id_ecdsa
  46. known_hosts: ${{ secrets.PACKAGES_KNOWN_HOSTS }}
  47. - name: Sync newer releases
  48. id: sync-releases
  49. if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && steps.check-newer-releases.outputs.versions_needs_update == 'true'
  50. run: |
  51. .github/scripts/upload-new-version-tags.sh
  52. - name: Failure Notification
  53. uses: rtCamp/action-slack-notify@v2
  54. env:
  55. SLACK_COLOR: 'danger'
  56. SLACK_FOOTER: ''
  57. SLACK_ICON_EMOJI: ':github-actions:'
  58. SLACK_TITLE: 'Failed to prepare changelog:'
  59. SLACK_USERNAME: 'GitHub Actions'
  60. SLACK_MESSAGE: |-
  61. ${{ github.repository }}: Failed to update stable Agent's metadata.
  62. Checkout: ${{ steps.checkout.outcome }}
  63. Init python: ${{ steps.init-python.outcome }}
  64. Setup python: ${{ steps.setup-python.outcome }}
  65. Check for newer stable releaes: ${{ steps.check-newer-releases.outcome }}
  66. Setup ssh: ${{ steps.ssh-setup.outcome }}
  67. Syncing newer release to packages.netdata.cloud : ${{ steps.sync-releases.outcome }}
  68. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  69. if: failure()