12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- ---
- name: Monitor releases
- on:
- release:
- types: [released, deleted]
- workflow_dispatch:
- inputs:
- channel:
- description: 'Specify the release channel'
- required: true
- default: 'stable'
- concurrency:
- group: monitor-{{ github.event.inputs.channel }}-releases-${{ github.ref }}-${{ github.event_name }}
- cancel-in-progress: true
- jobs:
- update-agents-metadata:
- name: update-agents-metadata
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- id: checkout
- uses: actions/checkout@v4
- with:
- token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
- - name: Overwrite defaults
- id: ow-defaults
- run: |
- if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
- echo "RELEASE_CHANNEL=${{ github.event.inputs.channel }}" >> "${GITHUB_ENV}"
- else
- echo "RELEASE_CHANNEL=stable" >> "${GITHUB_ENV}"
- fi
- - name: Init Python environment
- uses: actions/setup-python@v5
- id: init-python
- with:
- python-version: "3.12"
- - name: Setup python environment
- id: setup-python
- run: |
- pip install -r .github/scripts/modules/requirements.txt
- - name: Check for newer versions
- id: check-newer-releases
- run: |
- python .github/scripts/check_latest_versions_per_channel.py "${{ env.RELEASE_CHANNEL }}"
- - name: SSH setup
- id: ssh-setup
- if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && steps.check-newer-releases.outputs.versions_needs_update == 'true'
- uses: shimataro/ssh-key-action@v2
- with:
- key: ${{ secrets.NETDATABOT_PACKAGES_SSH_KEY }}
- name: id_ecdsa
- known_hosts: ${{ secrets.PACKAGES_KNOWN_HOSTS }}
- - name: Sync newer releases to packages.netdata.cloud
- id: sync-releases
- continue-on-error: true
- if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && steps.check-newer-releases.outputs.versions_needs_update == 'true'
- run: |
- .github/scripts/upload-new-version-tags.sh packages.netdata.cloud
- - name: Sync newer releases to packages2.netdata.cloud
- id: sync-releases2
- if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && steps.check-newer-releases.outputs.versions_needs_update == 'true'
- run: |
- .github/scripts/upload-new-version-tags.sh packages2.netdata.cloud
- - name: Failure Notification
- uses: rtCamp/action-slack-notify@v2
- env:
- SLACK_COLOR: 'danger'
- SLACK_FOOTER: ''
- SLACK_ICON_EMOJI: ':github-actions:'
- SLACK_TITLE: 'Failed to prepare changelog:'
- SLACK_USERNAME: 'GitHub Actions'
- SLACK_MESSAGE: |-
- ${{ github.repository }}: Failed to update stable Agent's metadata.
- Checkout: ${{ steps.checkout.outcome }}
- Overwrite inputs: ${{ steps.ow-defaults.outcome }}
- Init python: ${{ steps.init-python.outcome }}
- Setup python: ${{ steps.setup-python.outcome }}
- Check for newer stable releaes: ${{ steps.check-newer-releases.outcome }}
- Setup ssh: ${{ steps.ssh-setup.outcome }}
- Syncing newer release to packages.netdata.cloud : ${{ steps.sync-releases.outcome }}
- Syncing newer release to packages2.netdata.cloud : ${{ steps.sync-releases2.outcome }}
- SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
- if: failure()
|