2022-03-09 13:30:47 +00:00
|
|
|
---
|
|
|
|
# Workflow for triggering a release.
|
|
|
|
name: Release
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 0 * * *'
|
|
|
|
workflow_dispatch: # Dispatch runs build and validate, then push to the appropriate storage location.
|
|
|
|
inputs:
|
|
|
|
type:
|
|
|
|
description: Build Type
|
|
|
|
default: nightly
|
|
|
|
required: true
|
|
|
|
version:
|
|
|
|
description: Version Tag
|
|
|
|
default: nightly
|
|
|
|
required: true
|
|
|
|
concurrency: # This keeps multiple instances of the job from running concurrently for the same ref and event type.
|
|
|
|
group: release-${{ github.ref }}-${{ github.event_name }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
|
|
update-changelogs:
|
|
|
|
name: Update changelog
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
ref: ${{ steps.target.outputs.ref }}
|
|
|
|
version: ${{ steps.target.outputs.version }}
|
2022-03-25 22:01:12 +00:00
|
|
|
type: ${{ steps.target.outputs.type }}
|
2022-03-09 13:30:47 +00:00
|
|
|
run: ${{ steps.target.outputs.run }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
id: checkout
|
2023-09-11 11:16:49 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-03-09 13:30:47 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
submodules: recursive
|
2022-03-11 12:55:13 +00:00
|
|
|
token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
|
2022-03-09 13:30:47 +00:00
|
|
|
- name: Prepare base ref
|
|
|
|
id: target
|
|
|
|
run: >-
|
2022-03-10 20:15:55 +00:00
|
|
|
.github/scripts/prepare-release-base.sh \
|
2022-03-09 13:30:47 +00:00
|
|
|
${{ github.repository }} \
|
|
|
|
${{ github.event_name }} \
|
|
|
|
${{ github.event.inputs.type }} \
|
2022-07-12 12:35:37 +00:00
|
|
|
${{ github.event.inputs.version }} \
|
|
|
|
${{ secrets.NETDATA_RELEASE_TEST }}
|
2022-03-10 20:15:55 +00:00
|
|
|
- name: Generate Nightly Changleog
|
|
|
|
id: nightly-changelog
|
|
|
|
if: steps.target.outputs.run == 'true' && steps.target.outputs.type == 'nightly'
|
2023-12-11 15:56:18 +00:00
|
|
|
uses: heinrichreimer/github-changelog-generator-action@v2.4
|
2022-03-10 20:15:55 +00:00
|
|
|
with:
|
|
|
|
bugLabels: IGNOREBUGS
|
|
|
|
excludeLabels: "stale,duplicate,question,invalid,wontfix,discussion,no changelog"
|
|
|
|
issues: false
|
|
|
|
sinceTag: v1.10.0
|
|
|
|
token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
|
|
|
|
unreleasedLabel: "**Next release**"
|
|
|
|
verbose: true
|
2022-03-11 11:21:45 +00:00
|
|
|
maxIssues: 500
|
2022-03-10 20:15:55 +00:00
|
|
|
- name: Generate Release Changelog
|
|
|
|
id: release-changelog
|
|
|
|
if: steps.target.outputs.run == 'true' && steps.target.outputs.type != 'nightly'
|
2023-12-07 14:43:21 +00:00
|
|
|
uses: heinrichreimer/github-changelog-generator-action@v2.4
|
2022-03-10 20:15:55 +00:00
|
|
|
with:
|
|
|
|
bugLabels: IGNOREBUGS
|
|
|
|
excludeLabels: "stale,duplicate,question,invalid,wontfix,discussion,no changelog"
|
|
|
|
futureRelease: ${{ github.event.inputs.version }}
|
|
|
|
issues: false
|
|
|
|
sinceTag: v1.10.0
|
|
|
|
token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
|
|
|
|
unreleasedLabel: "**Next release**"
|
|
|
|
verbose: true
|
2022-03-11 11:21:45 +00:00
|
|
|
maxIssues: 500
|
2022-03-10 20:15:55 +00:00
|
|
|
- name: Commit Changes
|
|
|
|
id: commit
|
|
|
|
if: steps.target.outputs.run == 'true'
|
2022-03-11 12:55:13 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
|
2022-03-10 20:15:55 +00:00
|
|
|
run: |
|
|
|
|
git config user.name "netdatabot"
|
|
|
|
git config user.email "bot@netdata.cloud"
|
|
|
|
git add packaging/version CHANGELOG.md
|
|
|
|
git commit -m "[ci skip] ${{ steps.target.outputs.message }}"
|
|
|
|
if [ "${{ steps.target.outputs.type }}" != "nightly" ]; then
|
2022-04-15 15:52:10 +00:00
|
|
|
git tag -a "${{ github.event.inputs.version }}" -m "${{ steps.target.outputs.message }}"
|
2022-04-15 12:16:41 +00:00
|
|
|
fi
|
|
|
|
if [ -n "${{ steps.target.outputs.new-branch }}" ]; then
|
|
|
|
git branch "${{ steps.target.outputs.new-branch }}"
|
|
|
|
fi
|
|
|
|
git push --tags origin "${{ steps.target.outputs.branch }}"
|
|
|
|
if [ -n "${{ steps.target.outputs.new-branch }}" ]; then
|
|
|
|
git push origin "${{ steps.target.outputs.new-branch }}"
|
2022-03-10 20:15:55 +00:00
|
|
|
fi
|
2022-03-09 13:30:47 +00:00
|
|
|
- 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'
|
2022-03-09 13:44:07 +00:00
|
|
|
SLACK_MESSAGE: |-
|
2022-03-09 13:30:47 +00:00
|
|
|
${{ github.repository }}: Failed to prepare changelog.
|
|
|
|
Checkout: ${{ steps.checkout.outcome }}
|
|
|
|
Prepare base ref: ${{ steps.target.outcome }}
|
2022-03-10 20:15:55 +00:00
|
|
|
Generate nightly changelog: ${{ steps.nightly-changelog.outcome }}
|
|
|
|
Generate release changelog: ${{ steps.release-changelog.outcome }}
|
|
|
|
Commit changes: ${{ steps.commit.outcome }}
|
2022-03-09 13:30:47 +00:00
|
|
|
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
|
|
if: failure()
|
|
|
|
|
|
|
|
trigger-artifacts:
|
|
|
|
name: Trigger artifact builds
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: update-changelogs
|
2022-06-16 11:04:00 +00:00
|
|
|
if: needs.update-changelogs.outputs.run == 'true'
|
2022-03-09 13:30:47 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
id: checkout
|
2023-09-11 11:16:49 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-03-09 13:30:47 +00:00
|
|
|
with:
|
|
|
|
ref: ${{ needs.update-changelogs.outputs.ref }}
|
|
|
|
- name: Trigger build
|
|
|
|
id: trigger
|
|
|
|
uses: benc-uk/workflow-dispatch@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
|
|
|
|
repo: ${{ github.repository }}
|
2023-07-11 00:30:18 +00:00
|
|
|
workflow: build.yml
|
2022-03-09 13:30:47 +00:00
|
|
|
ref: ${{ needs.update-changelogs.outputs.ref }}
|
2022-03-25 22:01:12 +00:00
|
|
|
inputs: '{"version": "${{ needs.update-changelogs.outputs.version }}", "type": "${{ needs.update-changelogs.outputs.type }}"}'
|
2022-03-09 13:30:47 +00:00
|
|
|
- name: Failure Notification
|
|
|
|
uses: rtCamp/action-slack-notify@v2
|
|
|
|
env:
|
|
|
|
SLACK_COLOR: 'danger'
|
|
|
|
SLACK_FOOTER: ''
|
|
|
|
SLACK_ICON_EMOJI: ':github-actions:'
|
2022-03-25 22:01:12 +00:00
|
|
|
SLACK_TITLE: 'Failed to trigger ${{ needs.update-changelogs.outputs.type }} artifact builds:'
|
2022-03-09 13:30:47 +00:00
|
|
|
SLACK_USERNAME: 'GitHub Actions'
|
2022-03-09 13:44:07 +00:00
|
|
|
SLACK_MESSAGE: |-
|
2022-03-25 22:01:12 +00:00
|
|
|
${{ github.repository }}: Failed to trigger ${{ needs.update-changelogs.outputs.type }} artifact builds.
|
2022-03-09 13:30:47 +00:00
|
|
|
Checkout: ${{ steps.checkout.outcome }}
|
|
|
|
Trigger build: ${{ steps.trigger.outcome }}
|
|
|
|
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
|
|
if: failure()
|
|
|
|
|
|
|
|
trigger-docker:
|
|
|
|
name: Trigger docker builds
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: update-changelogs
|
2022-06-16 11:04:00 +00:00
|
|
|
if: needs.update-changelogs.outputs.run == 'true'
|
2022-03-09 13:30:47 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
id: checkout
|
2023-09-11 11:16:49 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-03-09 13:30:47 +00:00
|
|
|
with:
|
|
|
|
ref: ${{ needs.update-changelogs.outputs.ref }}
|
|
|
|
- name: Trigger build
|
|
|
|
id: trigger
|
|
|
|
uses: benc-uk/workflow-dispatch@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
|
|
|
|
repo: ${{ github.repository }}
|
2023-07-11 00:30:18 +00:00
|
|
|
workflow: docker.yml
|
2022-03-09 13:30:47 +00:00
|
|
|
ref: ${{ needs.update-changelogs.outputs.ref }}
|
2022-03-11 13:59:08 +00:00
|
|
|
inputs: '{"version": "${{ needs.update-changelogs.outputs.version }}"}'
|
2022-03-09 13:30:47 +00:00
|
|
|
- name: Failure Notification
|
|
|
|
uses: rtCamp/action-slack-notify@v2
|
|
|
|
env:
|
|
|
|
SLACK_COLOR: 'danger'
|
|
|
|
SLACK_FOOTER: ''
|
|
|
|
SLACK_ICON_EMOJI: ':github-actions:'
|
2022-03-25 22:01:12 +00:00
|
|
|
SLACK_TITLE: 'Failed to trigger ${{ needs.update-changelogs.outputs.type }} Docker builds:'
|
2022-03-09 13:30:47 +00:00
|
|
|
SLACK_USERNAME: 'GitHub Actions'
|
2022-03-09 13:44:07 +00:00
|
|
|
SLACK_MESSAGE: |-
|
2022-03-25 22:01:12 +00:00
|
|
|
${{ github.repository }}: Failed to trigger ${{ needs.update-changelogs.outputs.type }} Docker builds.
|
2022-03-09 13:30:47 +00:00
|
|
|
Checkout: ${{ steps.checkout.outcome }}
|
|
|
|
Trigger build: ${{ steps.trigger.outcome }}
|
|
|
|
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
|
|
if: failure()
|
|
|
|
|
|
|
|
trigger-packages:
|
|
|
|
name: Trigger package builds
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: update-changelogs
|
2022-06-16 11:04:00 +00:00
|
|
|
if: needs.update-changelogs.outputs.run == 'true'
|
2022-03-09 13:30:47 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
id: checkout
|
2023-09-11 11:16:49 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-03-09 13:30:47 +00:00
|
|
|
with:
|
|
|
|
ref: ${{ needs.update-changelogs.outputs.ref }}
|
|
|
|
- name: Trigger build
|
|
|
|
id: trigger
|
|
|
|
uses: benc-uk/workflow-dispatch@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
|
|
|
|
repo: ${{ github.repository }}
|
2023-07-11 00:30:18 +00:00
|
|
|
workflow: packaging.yml
|
2022-03-09 13:30:47 +00:00
|
|
|
ref: ${{ needs.update-changelogs.outputs.ref }}
|
2022-03-25 22:01:12 +00:00
|
|
|
inputs: '{"version": "${{ needs.update-changelogs.outputs.version }}", "type": "${{ needs.update-changelogs.outputs.type }}"}'
|
2022-03-09 13:30:47 +00:00
|
|
|
- name: Failure Notification
|
|
|
|
uses: rtCamp/action-slack-notify@v2
|
|
|
|
env:
|
|
|
|
SLACK_COLOR: 'danger'
|
|
|
|
SLACK_FOOTER: ''
|
|
|
|
SLACK_ICON_EMOJI: ':github-actions:'
|
2022-03-25 22:01:12 +00:00
|
|
|
SLACK_TITLE: 'Failed to trigger ${{ needs.update-changelogs.outputs.type }} package builds:'
|
2022-03-09 13:30:47 +00:00
|
|
|
SLACK_USERNAME: 'GitHub Actions'
|
2022-03-09 13:44:07 +00:00
|
|
|
SLACK_MESSAGE: |-
|
2022-03-25 22:01:12 +00:00
|
|
|
${{ github.repository }}: Failed to trigger ${{ needs.update-changelogs.outputs.type }} package builds.
|
2022-03-09 13:30:47 +00:00
|
|
|
Checkout: ${{ steps.checkout.outcome }}
|
|
|
|
Trigger build: ${{ steps.trigger.outcome }}
|
|
|
|
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
|
|
if: failure()
|