build.yml 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076
  1. ---
  2. # Ci code for building release artifacts.
  3. name: Build
  4. on:
  5. push: # Master branch checks only validate the build and generate artifacts for testing.
  6. branches:
  7. - master
  8. pull_request: null # PR checks only validate the build and generate artifacts for testing.
  9. workflow_dispatch: # Dispatch runs build and validate, then push to the appropriate storage location.
  10. inputs:
  11. type:
  12. description: Build Type
  13. default: nightly
  14. required: true
  15. version:
  16. description: Version Tag
  17. default: nightly
  18. required: true
  19. concurrency: # This keeps multiple instances of the job from running concurrently for the same ref and event type.
  20. group: build-${{ github.ref }}-${{ github.event_name }}
  21. cancel-in-progress: true
  22. jobs:
  23. file-check: # Check what files changed if we’re being run in a PR or on a push.
  24. name: Check Modified Files
  25. runs-on: ubuntu-latest
  26. outputs:
  27. run: ${{ steps.check-run.outputs.run }}
  28. skip-go: ${{ steps.check-go.outputs.skip-go }}
  29. steps:
  30. - name: Checkout
  31. id: checkout
  32. uses: actions/checkout@v4
  33. with:
  34. fetch-depth: 0
  35. submodules: recursive
  36. - name: Check source files
  37. id: check-source-files
  38. uses: tj-actions/changed-files@v44
  39. with:
  40. since_last_remote_commit: ${{ github.event_name != 'pull_request' }}
  41. files: |
  42. **/*.c
  43. **/*.cc
  44. **/*.h
  45. **/*.hh
  46. **/*.in
  47. **/*.patch
  48. src/aclk/aclk-schemas/
  49. src/ml/dlib/
  50. src/fluent-bit/
  51. src/web/server/h2o/libh2o/
  52. files_ignore: |
  53. netdata.spec.in
  54. **/*.md
  55. - name: Check build files
  56. id: check-build-files
  57. uses: tj-actions/changed-files@v44
  58. with:
  59. since_last_remote_commit: ${{ github.event_name != 'pull_request' }}
  60. files: |
  61. **/*.cmake
  62. CMakeLists.txt
  63. netdata-installer.sh
  64. .github/data/distros.yml
  65. .github/workflows/build.yml
  66. .github/scripts/build-static.sh
  67. .github/scripts/get-static-cache-key.sh
  68. .github/scripts/gen-matrix-build.py
  69. .github/scripts/run-updater-check.sh
  70. packaging/cmake/
  71. packaging/makeself/
  72. packaging/installer/
  73. packaging/*.sh
  74. packaging/*.version
  75. packaging/*.checksums
  76. files_ignore: |
  77. **/*.md
  78. packaging/repoconfig/
  79. - name: List all changed files in pattern
  80. continue-on-error: true
  81. env:
  82. CHANGED_SOURCE_FILES: ${{ steps.check-source-files.outputs.all_changed_files }}
  83. CHANGED_BUILD_FILES: ${{ steps.check-build-files.outputs.all_changed_files }}
  84. run: |
  85. for file in ${CHANGED_SOURCE_FILES} ${CHANGED_BUILD_FILES} ; do
  86. echo "$file was changed"
  87. done
  88. - name: Check Run
  89. id: check-run
  90. run: |
  91. if [ "${{ steps.check-source-files.outputs.any_modified }}" == "true" ] || [ "${{ steps.check-build-files.outputs.any_modified }}" == "true" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
  92. echo 'run=true' >> "${GITHUB_OUTPUT}"
  93. else
  94. echo 'run=false' >> "${GITHUB_OUTPUT}"
  95. fi
  96. - name: Check Go
  97. id: check-go
  98. env:
  99. OTHER_CHANGED_FILES: ${{ steps.check-source-files.outputs.other_changed_files }}
  100. run: |
  101. if [ '${{ github.event_name }}' == 'pull_request' ]; then
  102. if echo "${OTHER_CHANGED_FILES}" | grep -q '.*/(.*\.go|go\.mod|go\.sum)$' || [ "${{ steps.check-build-files.outputs.any_modified }}" == "true" ]; then
  103. echo 'skip-go=' >> "${GITHUB_OUTPUT}"
  104. else
  105. echo 'skip-go=--disable-go' >> "${GITHUB_OUTPUT}"
  106. fi
  107. else
  108. echo 'skip-go=' >> "${GITHUB_OUTPUT}"
  109. fi
  110. build-dist: # Build the distribution tarball and store it as an artifact.
  111. name: Build Distribution Tarball
  112. runs-on: ubuntu-latest
  113. needs:
  114. - file-check
  115. outputs:
  116. distfile: ${{ steps.build.outputs.distfile }}
  117. steps:
  118. - name: Skip Check
  119. id: skip
  120. if: needs.file-check.outputs.run != 'true'
  121. run: echo "SKIPPED"
  122. - name: Checkout
  123. id: checkout
  124. if: needs.file-check.outputs.run == 'true'
  125. uses: actions/checkout@v4
  126. with:
  127. fetch-depth: 0
  128. submodules: recursive
  129. - name: Fix tags
  130. id: fix-tags
  131. if: github.event_name != 'push' && needs.file-check.outputs.run == 'true'
  132. run: |
  133. git fetch --tags --force
  134. - name: Mark Stable
  135. id: channel
  136. if: github.event_name == 'workflow_dispatch' && github.event.inputs.type != 'nightly' && needs.file-check.outputs.run == 'true'
  137. run: |
  138. sed -i 's/^RELEASE_CHANNEL="nightly"/RELEASE_CHANNEL="stable"/' netdata-installer.sh
  139. - name: Build
  140. id: build
  141. if: needs.file-check.outputs.run == 'true'
  142. run: |
  143. mkdir -p artifacts/
  144. tar --create --file "artifacts/netdata-$(git describe).tar.gz" \
  145. --sort=name --posix --auto-compress --exclude=artifacts/ --exclude=.git \
  146. --exclude=.gitignore --exclude=.gitattributes --exclude=.gitmodules \
  147. --transform "s/^\\.\\//netdata-$(git describe)\\//" --verbose .
  148. cd artifacts/
  149. echo "distfile=$(find . -name 'netdata-*.tar.gz')" >> "${GITHUB_OUTPUT}"
  150. - name: Store
  151. id: store
  152. if: needs.file-check.outputs.run == 'true'
  153. uses: actions/upload-artifact@v4
  154. with:
  155. name: dist-tarball
  156. path: artifacts/*.tar.gz
  157. retention-days: 30
  158. - name: Failure Notification
  159. uses: rtCamp/action-slack-notify@v2
  160. env:
  161. SLACK_COLOR: 'danger'
  162. SLACK_FOOTER: ''
  163. SLACK_ICON_EMOJI: ':github-actions:'
  164. SLACK_TITLE: 'Distribution tarball creation failed:'
  165. SLACK_USERNAME: 'GitHub Actions'
  166. SLACK_MESSAGE: |-
  167. ${{ github.repository }}: Failed to create source tarball for distribution.
  168. Checkout: ${{ steps.checkout.outcome }}
  169. Fix Tags: ${{ steps.fix-tags.outcome }}
  170. Mark stable: ${{ steps.channel.outcome }}
  171. Build: ${{ steps.build.outcome }}
  172. Store: ${{ steps.store.outcome }}
  173. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  174. if: >-
  175. ${{
  176. failure()
  177. && startsWith(github.ref, 'refs/heads/master')
  178. && github.event_name != 'pull_request'
  179. && github.repository == 'netdata/netdata'
  180. && needs.file-check.outputs.run == 'true'
  181. }}
  182. build-static: # Build the static binary archives, and store them as artifacts.
  183. name: Build Static
  184. runs-on: ubuntu-latest
  185. needs:
  186. - file-check
  187. strategy:
  188. matrix:
  189. arch:
  190. - x86_64
  191. - armv6l
  192. - armv7l
  193. - aarch64
  194. - ppc64le
  195. steps:
  196. - name: Skip Check
  197. id: skip
  198. if: needs.file-check.outputs.run != 'true'
  199. run: echo "SKIPPED"
  200. - name: Checkout
  201. id: checkout
  202. if: needs.file-check.outputs.run == 'true'
  203. uses: actions/checkout@v4
  204. with:
  205. fetch-depth: 0
  206. submodules: recursive
  207. - name: Fix tags
  208. id: fix-tags
  209. if: github.event_name != 'push' && needs.file-check.outputs.run == 'true'
  210. run: |
  211. git fetch --tags --force
  212. - name: Mark Stable
  213. id: channel
  214. if: github.event_name == 'workflow_dispatch' && github.event.inputs.type != 'nightly' && needs.file-check.outputs.run == 'true'
  215. run: |
  216. sed -i 's/^RELEASE_CHANNEL="nightly"/RELEASE_CHANNEL="stable"/' netdata-installer.sh packaging/makeself/install-or-update.sh
  217. - name: Get Cache Key
  218. if: (github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'run-ci/no-cache')) && needs.file-check.outputs.run == 'true'
  219. id: cache-key
  220. run: .github/scripts/get-static-cache-key.sh ${{ matrix.arch }} "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/no-cache') }}"
  221. - name: Cache
  222. if: (github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'run-ci/no-cache')) && needs.file-check.outputs.run == 'true'
  223. id: cache
  224. uses: actions/cache@v4
  225. with:
  226. path: artifacts/cache
  227. key: ${{ steps.cache-key.outputs.key }}
  228. - name: Build
  229. if: github.event_name != 'workflow_dispatch' && needs.file-check.outputs.run == 'true' # Don’t use retries on PRs.
  230. run: |
  231. export EXTRA_INSTALL_FLAGS=${{ needs.file-check.outputs.skip-go }}
  232. .github/scripts/build-static.sh ${{ matrix.arch }}
  233. - name: Build
  234. if: github.event_name == 'workflow_dispatch' && needs.file-check.outputs.run == 'true'
  235. id: build
  236. uses: nick-fields/retry@v3
  237. with:
  238. timeout_minutes: 180
  239. max_attempts: 3
  240. command: |
  241. export EXTRA_INSTALL_FLAGS=${{ needs.file-check.outputs.skip-go }}
  242. .github/scripts/build-static.sh ${{ matrix.arch }}
  243. - name: Store
  244. id: store
  245. if: needs.file-check.outputs.run == 'true'
  246. uses: actions/upload-artifact@v4
  247. with:
  248. name: dist-static-${{ matrix.arch }}
  249. path: artifacts/*.gz.run
  250. retention-days: 30
  251. - name: Failure Notification
  252. uses: rtCamp/action-slack-notify@v2
  253. env:
  254. SLACK_COLOR: 'danger'
  255. SLACK_FOOTER: ''
  256. SLACK_ICON_EMOJI: ':github-actions:'
  257. SLACK_TITLE: 'Static build failed:'
  258. SLACK_USERNAME: 'GitHub Actions'
  259. SLACK_MESSAGE: |-
  260. ${{ github.repository }}: Failed to create static installer archive for ${{ matrix.arch }}.
  261. Checkout: ${{ steps.checkout.outcome }}
  262. Fix Tags: ${{ steps.fix-tags.outcome }}
  263. Mark stable: ${{ steps.channel.outcome }}
  264. Build: ${{ steps.build.outcome }}
  265. Store: ${{ steps.store.outcome }}
  266. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  267. if: >-
  268. ${{
  269. failure()
  270. && startsWith(github.ref, 'refs/heads/master')
  271. && github.event_name != 'pull_request'
  272. && github.repository == 'netdata/netdata'
  273. && needs.file-check.outputs.run == 'true'
  274. }}
  275. matrix: # Generate the shared build matrix for our build tests.
  276. name: Prepare Build Matrix
  277. runs-on: ubuntu-latest
  278. if: github.event_name != 'workflow_dispatch'
  279. outputs:
  280. matrix: ${{ steps.set-matrix.outputs.matrix }}
  281. steps:
  282. - name: Checkout
  283. id: checkout
  284. uses: actions/checkout@v4
  285. - name: Prepare tools
  286. id: prepare
  287. run: |
  288. sudo apt-get update || true
  289. sudo apt-get install -y python3-ruamel.yaml
  290. - name: Read build matrix
  291. id: set-matrix
  292. run: |
  293. matrix="$(.github/scripts/gen-matrix-build.py)"
  294. echo "Generated matrix: ${matrix}"
  295. echo "matrix=${matrix}" >> "${GITHUB_OUTPUT}"
  296. - name: Failure Notification
  297. uses: rtCamp/action-slack-notify@v2
  298. env:
  299. SLACK_COLOR: 'danger'
  300. SLACK_FOOTER: ''
  301. SLACK_ICON_EMOJI: ':github-actions:'
  302. SLACK_TITLE: 'Build matrix preparation failed:'
  303. SLACK_USERNAME: 'GitHub Actions'
  304. SLACK_MESSAGE: |-
  305. ${{ github.repository }}: Failed to prepare build matrix for build checks.
  306. Checkout: ${{ steps.checkout.outcome }}
  307. Prepare tools: ${{ steps.prepare.outcome }}
  308. Read build matrix: ${{ steps.set-matrix.outcome }}
  309. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  310. if: >-
  311. ${{
  312. failure()
  313. && startsWith(github.ref, 'refs/heads/master')
  314. && github.event_name != 'pull_request'
  315. && github.repository == 'netdata/netdata'
  316. }}
  317. prepare-test-images: # Prepare the test environments for our build checks. This also checks dependency handling code for each tested environment.
  318. name: Prepare Test Environments
  319. runs-on: ubuntu-latest
  320. if: github.event_name != 'workflow_dispatch'
  321. needs:
  322. - matrix
  323. env:
  324. RETRY_DELAY: 300
  325. strategy:
  326. # Unlike the actual build tests, this completes _very_ fast (average of about 3 minutes for each job), so we
  327. # just run everything in parallel instead lof limiting job concurrency.
  328. fail-fast: false
  329. matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
  330. steps:
  331. - name: Checkout
  332. id: checkout
  333. uses: actions/checkout@v4
  334. - name: Setup Buildx
  335. id: buildx
  336. uses: docker/setup-buildx-action@v3
  337. - name: Build test environment
  338. id: build1
  339. uses: docker/build-push-action@v5
  340. continue-on-error: true # We retry 3 times at 5 minute intervals if there is a failure here.
  341. with:
  342. push: false
  343. load: false
  344. file: .github/dockerfiles/Dockerfile.build_test
  345. build-args: |
  346. BASE=${{ matrix.distro }}
  347. PRE=${{ matrix.env_prep }}
  348. RMJSONC=${{ matrix.jsonc_removal }}
  349. outputs: type=docker,dest=/tmp/image.tar
  350. tags: test:${{ matrix.artifact_key }}
  351. - name: Retry delay
  352. if: ${{ steps.build1.outcome == 'failure' }}
  353. run: sleep "${RETRY_DELAY}"
  354. - name: Build test environment (attempt 2)
  355. if: ${{ steps.build1.outcome == 'failure' }}
  356. id: build2
  357. uses: docker/build-push-action@v5
  358. continue-on-error: true # We retry 3 times at 5 minute intervals if there is a failure here.
  359. with:
  360. push: false
  361. load: false
  362. file: .github/dockerfiles/Dockerfile.build_test
  363. build-args: |
  364. BASE=${{ matrix.distro }}
  365. PRE=${{ matrix.env_prep }}
  366. RMJSONC=${{ matrix.jsonc_removal }}
  367. outputs: type=docker,dest=/tmp/image.tar
  368. tags: test:${{ matrix.artifact_key }}
  369. - name: Retry delay
  370. if: ${{ steps.build1.outcome == 'failure' && steps.build2.outcome == 'failure' }}
  371. run: sleep "${RETRY_DELAY}"
  372. - name: Build test environment (attempt 3)
  373. if: ${{ steps.build1.outcome == 'failure' && steps.build2.outcome == 'failure' }}
  374. id: build3
  375. uses: docker/build-push-action@v5
  376. with:
  377. push: false
  378. load: false
  379. file: .github/dockerfiles/Dockerfile.build_test
  380. build-args: |
  381. BASE=${{ matrix.distro }}
  382. PRE=${{ matrix.env_prep }}
  383. RMJSONC=${{ matrix.jsonc_removal }}
  384. outputs: type=docker,dest=/tmp/image.tar
  385. tags: test:${{ matrix.artifact_key }}
  386. - name: Upload image artifact
  387. id: upload
  388. uses: actions/upload-artifact@v4
  389. with:
  390. name: ${{ matrix.artifact_key }}-test-env
  391. path: /tmp/image.tar
  392. retention-days: 30
  393. - name: Failure Notification
  394. uses: rtCamp/action-slack-notify@v2
  395. env:
  396. SLACK_COLOR: 'danger'
  397. SLACK_FOOTER: ''
  398. SLACK_ICON_EMOJI: ':github-actions:'
  399. SLACK_TITLE: 'Test environment preparation for ${{ matrix.distro }} failed:'
  400. SLACK_USERNAME: 'GitHub Actions'
  401. SLACK_MESSAGE: |-
  402. ${{ github.repository }}: Test environment preparation for ${{ matrix.distro }} failed.
  403. Checkout: ${{ steps.checkout.outcome }}
  404. Set up Buildx: ${{ steps.buildx.outcome }}
  405. Build test environment: ${{ steps.build1.outcome }}
  406. Build test environment (attempt 2): ${{ steps.build2.outcome }}
  407. Build test environment (attempt 3): ${{ steps.build3.outcome }}
  408. Upload: ${{ steps.upload.outcome }}
  409. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  410. if: >-
  411. ${{
  412. failure()
  413. && startsWith(github.ref, 'refs/heads/master')
  414. && github.event_name != 'pull_request'
  415. && github.repository == 'netdata/netdata'
  416. }}
  417. source-build: # Test various source build arrangements.
  418. name: Test Source Build
  419. runs-on: ubuntu-latest
  420. if: github.event_name != 'workflow_dispatch'
  421. needs:
  422. - matrix
  423. - prepare-test-images
  424. - file-check
  425. strategy:
  426. fail-fast: false
  427. max-parallel: 8
  428. matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
  429. steps:
  430. - name: Skip Check
  431. id: skip
  432. if: needs.file-check.outputs.run != 'true'
  433. run: echo "SKIPPED"
  434. - name: Checkout
  435. id: checkout
  436. if: needs.file-check.outputs.run == 'true'
  437. uses: actions/checkout@v4
  438. with:
  439. submodules: recursive
  440. - name: Fetch test environment
  441. id: fetch
  442. if: needs.file-check.outputs.run == 'true'
  443. uses: Wandalen/wretry.action@v3
  444. with:
  445. action: actions/download-artifact@v4
  446. with: |
  447. name: ${{ matrix.artifact_key }}-test-env
  448. path: .
  449. attempt_limit: 3
  450. attempt_delay: 2000
  451. - name: Load test environment
  452. id: load
  453. if: needs.file-check.outputs.run == 'true'
  454. run: docker load --input image.tar
  455. - name: netdata-installer on ${{ matrix.distro }}, disable cloud
  456. id: build-no-cloud
  457. if: needs.file-check.outputs.run == 'true'
  458. run: |
  459. docker run --security-opt seccomp=unconfined -w /netdata test:${{ matrix.artifact_key }} \
  460. /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it --disable-cloud --one-time-build ${{ needs.file-check.outputs.skip-go }}'
  461. - name: netdata-installer on ${{ matrix.distro }}, require cloud
  462. id: build-cloud
  463. if: needs.file-check.outputs.run == 'true'
  464. run: |
  465. docker run --security-opt seccomp=unconfined -w /netdata test:${{ matrix.artifact_key }} \
  466. /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it --require-cloud --one-time-build ${{ needs.file-check.outputs.skip-go }}'
  467. - name: netdata-installer on ${{ matrix.distro }}, require cloud, no JSON-C
  468. id: build-no-jsonc
  469. if: matrix.jsonc_removal != '' && needs.file-check.outputs.run == 'true'
  470. run: |
  471. docker run --security-opt seccomp=unconfined -w /netdata test:${{ matrix.artifact_key }} \
  472. /bin/sh -c '/rmjsonc.sh && ./netdata-installer.sh --dont-wait --dont-start-it --require-cloud --one-time-build ${{ needs.file-check.outputs.skip-go }}'
  473. - name: Failure Notification
  474. uses: rtCamp/action-slack-notify@v2
  475. env:
  476. SLACK_COLOR: 'danger'
  477. SLACK_FOOTER: ''
  478. SLACK_ICON_EMOJI: ':github-actions:'
  479. SLACK_TITLE: 'Build tests for ${{ matrix.distro }} failed:'
  480. SLACK_USERNAME: 'GitHub Actions'
  481. SLACK_MESSAGE: |-
  482. ${{ github.repository }}: Build tests for ${{ matrix.distro }} failed.
  483. Checkout: ${{ steps.checkout.outcome }}
  484. Fetch test environment: ${{ steps.fetch.outcome }}
  485. Load test environment: ${{ steps.load.outcome }}
  486. netdata-installer, disable cloud: ${{ steps.build-no-cloud.outcome }}
  487. netdata-installer, require cloud: ${{ steps.build-cloud.outcome }}
  488. netdata-installer, no JSON-C: ${{ steps.build-no-jsonc.outcome }}
  489. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  490. if: >-
  491. ${{
  492. failure()
  493. && startsWith(github.ref, 'refs/heads/master')
  494. && github.event_name != 'pull_request'
  495. && github.repository == 'netdata/netdata'
  496. && needs.file-check.outputs.run == 'true'
  497. }}
  498. updater-check: # Test the generated dist archive using the updater code.
  499. name: Test Generated Distfile and Updater Code
  500. runs-on: ubuntu-latest
  501. if: github.event_name != 'workflow_dispatch'
  502. needs:
  503. - build-dist
  504. - matrix
  505. - prepare-test-images
  506. - file-check
  507. strategy:
  508. fail-fast: false
  509. max-parallel: 8
  510. matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
  511. services:
  512. apache: # This gets used to serve the dist tarball for the updater script.
  513. image: httpd:2.4
  514. ports:
  515. - 8080:80
  516. volumes:
  517. - ${{ github.workspace }}:/usr/local/apache2/htdocs/
  518. steps:
  519. - name: Skip Check
  520. id: skip
  521. if: needs.file-check.outputs.run != 'true'
  522. run: echo "SKIPPED"
  523. - name: Checkout
  524. id: checkout
  525. if: needs.file-check.outputs.run == 'true'
  526. uses: actions/checkout@v4
  527. - name: Fetch dist tarball artifacts
  528. id: fetch-tarball
  529. if: needs.file-check.outputs.run == 'true'
  530. uses: Wandalen/wretry.action@v3
  531. with:
  532. action: actions/download-artifact@v4
  533. with: |
  534. name: dist-tarball
  535. path: dist-tarball
  536. attempt_limit: 3
  537. attempt_delay: 2000
  538. - name: Prepare artifact directory
  539. id: prepare
  540. if: needs.file-check.outputs.run == 'true'
  541. run: |
  542. mkdir -p artifacts/download/v9999.0.0 || exit 1
  543. mkdir -p artifacts/latest || exit 1
  544. echo "v9999.0.0" > artifacts/latest/latest-version.txt || exit 1
  545. cp dist-tarball/* artifacts/download/v9999.0.0 || exit 1
  546. cd artifacts/download/v9999.0.0 || exit 1
  547. ln -s ${{ needs.build-dist.outputs.distfile }} netdata-latest.tar.gz || exit 1
  548. ls -lFh
  549. sha256sum -b ./* > "sha256sums.txt" || exit 1
  550. cat sha256sums.txt
  551. cd ../.. || exit 1
  552. ls -lR
  553. - name: Fetch test environment
  554. id: fetch-test-environment
  555. if: needs.file-check.outputs.run == 'true'
  556. uses: Wandalen/wretry.action@v3
  557. with:
  558. action: actions/download-artifact@v4
  559. with: |
  560. name: ${{ matrix.artifact_key }}-test-env
  561. path: .
  562. attempt_limit: 3
  563. attempt_delay: 2000
  564. - name: Load test environment
  565. id: load
  566. if: needs.file-check.outputs.run == 'true'
  567. run: docker load --input image.tar
  568. - name: Install netdata and run the updater on ${{ matrix.distro }}
  569. id: updater-check
  570. if: needs.file-check.outputs.run == 'true'
  571. run: |
  572. docker run --security-opt seccomp=unconfined -e DISABLE_TELEMETRY=1 --network host -w /netdata \
  573. -e EXTRA_INSTALL_FLAGS=${{ needs.file-check.outputs.skip-go }} \
  574. test:${{ matrix.artifact_key }} /netdata/.github/scripts/run-updater-check.sh
  575. - name: Failure Notification
  576. uses: rtCamp/action-slack-notify@v2
  577. env:
  578. SLACK_COLOR: 'danger'
  579. SLACK_FOOTER: ''
  580. SLACK_ICON_EMOJI: ':github-actions:'
  581. SLACK_TITLE: 'Updater checks for ${{ matrix.distro }} failed:'
  582. SLACK_USERNAME: 'GitHub Actions'
  583. SLACK_MESSAGE: |-
  584. ${{ github.repository }}: Updater checks for ${{ matrix.distro }} failed.
  585. Checkout: ${{ steps.checkout.outcome }}
  586. Fetch dist tarball: ${{ steps.fetch-tarball.outcome }}
  587. Prepare artifact directory: ${{ steps.prepare.outcome }}
  588. Fetch test environment: ${{ steps.fetch-test-environment.outcome }}
  589. Load test environment: ${{ steps.load.outcome }}
  590. Updater check: ${{ steps.updater-check.outcome }}
  591. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  592. if: >-
  593. ${{
  594. failure()
  595. && startsWith(github.ref, 'refs/heads/master')
  596. && github.event_name != 'pull_request'
  597. && github.repository == 'netdata/netdata'
  598. && needs.file-check.outputs.run == 'true'
  599. }}
  600. prepare-upload: # Consolidate the artifacts for uploading or releasing.
  601. name: Prepare Artifacts
  602. runs-on: ubuntu-latest
  603. needs:
  604. - build-dist
  605. - build-static
  606. - file-check
  607. steps:
  608. - name: Skip Check
  609. id: skip
  610. if: needs.file-check.outputs.run != 'true'
  611. run: echo "SKIPPED"
  612. - name: Checkout
  613. id: checkout
  614. if: needs.file-check.outputs.run == 'true'
  615. uses: actions/checkout@v4
  616. - name: Prepare Environment
  617. id: prepare
  618. if: needs.file-check.outputs.run == 'true'
  619. run: mkdir -p artifacts
  620. - name: Retrieve Build Artifacts
  621. id: fetch-dist
  622. if: needs.file-check.outputs.run == 'true'
  623. uses: Wandalen/wretry.action@v3
  624. with:
  625. action: actions/download-artifact@v4
  626. with: |
  627. pattern: dist-*
  628. path: dist-artifacts
  629. merge-multiple: true
  630. attempt_limit: 3
  631. attempt_delay: 2000
  632. - name: Prepare Artifacts
  633. id: consolidate
  634. if: needs.file-check.outputs.run == 'true'
  635. working-directory: ./artifacts/
  636. run: |
  637. mv ../dist-artifacts/* . || exit 1
  638. ln -s ${{ needs.build-dist.outputs.distfile }} netdata-latest.tar.gz || exit 1
  639. cp ../packaging/version ./latest-version.txt || exit 1
  640. cp ../integrations/integrations.js ./integrations.js || exit 1
  641. sha256sum -b ./* > sha256sums.txt || exit 1
  642. cat sha256sums.txt
  643. - name: Store Artifacts
  644. id: store
  645. if: needs.file-check.outputs.run == 'true'
  646. uses: actions/upload-artifact@v4
  647. with:
  648. name: final-artifacts
  649. path: artifacts/*
  650. retention-days: 30
  651. - name: Failure Notification
  652. uses: rtCamp/action-slack-notify@v2
  653. env:
  654. SLACK_COLOR: 'danger'
  655. SLACK_FOOTER: ''
  656. SLACK_ICON_EMOJI: ':github-actions:'
  657. SLACK_TITLE: 'Failed to prepare release artifacts for upload:'
  658. SLACK_USERNAME: 'GitHub Actions'
  659. SLACK_MESSAGE: |-
  660. ${{ github.repository }}: Failed to prepare release artifacts for upload.
  661. Checkout: ${{ steps.checkout.outcome }}
  662. Prepare environment: ${{ steps.prepare.outcome }}
  663. Fetch dist tarball: ${{ steps.fetch-dist.outcome }}
  664. Consolidate artifacts: ${{ steps.consolidate.outcome }}
  665. Store: ${{ steps.store.outcome }}
  666. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  667. if: >-
  668. ${{
  669. failure()
  670. && startsWith(github.ref, 'refs/heads/master')
  671. && github.event_name != 'pull_request'
  672. && github.repository == 'netdata/netdata'
  673. && needs.file-check.outputs.run == 'true'
  674. }}
  675. artifact-verification-dist: # Verify the regular installer works with the consolidated artifacts.
  676. name: Test Consolidated Artifacts (Source)
  677. runs-on: ubuntu-latest
  678. needs:
  679. - prepare-upload
  680. - file-check
  681. services:
  682. apache: # This gets used to serve the dist tarball for the updater script.
  683. image: httpd:2.4
  684. ports:
  685. - 8080:80
  686. volumes:
  687. - ${{ github.workspace }}:/usr/local/apache2/htdocs/
  688. steps:
  689. - name: Skip Check
  690. id: skip
  691. if: needs.file-check.outputs.run != 'true'
  692. run: echo "SKIPPED"
  693. - name: Checkout
  694. id: checkout
  695. if: needs.file-check.outputs.run == 'true'
  696. uses: actions/checkout@v4
  697. - name: Fetch artifacts
  698. id: fetch
  699. if: needs.file-check.outputs.run == 'true'
  700. uses: Wandalen/wretry.action@v3
  701. with:
  702. action: actions/download-artifact@v4
  703. with: |
  704. name: final-artifacts
  705. path: artifacts
  706. attempt_limit: 3
  707. attempt_delay: 2000
  708. - name: Prepare artifacts directory
  709. id: prepare
  710. if: needs.file-check.outputs.run == 'true'
  711. run: |
  712. mkdir -p download/latest
  713. mv artifacts/* download/latest
  714. ls -al download/latest
  715. - name: Verify that artifacts work with installer
  716. id: verify
  717. if: needs.file-check.outputs.run == 'true'
  718. env:
  719. NETDATA_TARBALL_BASEURL: http://localhost:8080/
  720. run: packaging/installer/kickstart.sh --build-only --dont-start-it --disable-telemetry --dont-wait
  721. - name: Failure Notification
  722. uses: rtCamp/action-slack-notify@v2
  723. env:
  724. SLACK_COLOR: 'danger'
  725. SLACK_FOOTER: ''
  726. SLACK_ICON_EMOJI: ':github-actions:'
  727. SLACK_TITLE: 'Artifact verification for source tarball failed.'
  728. SLACK_USERNAME: 'GitHub Actions'
  729. SLACK_MESSAGE: |-
  730. ${{ github.repository }}: Artifact verification for source tarball failed.
  731. Checkout: ${{ steps.checkout.outcome }}
  732. Fetch artifacts: ${{ steps.fetch.outcome }}
  733. Verify artifacts: ${{ steps.verify.outcome }}
  734. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  735. if: >-
  736. ${{
  737. failure()
  738. && startsWith(github.ref, 'refs/heads/master')
  739. && github.event_name != 'pull_request'
  740. && github.repository == 'netdata/netdata'
  741. && needs.file-check.outputs.run == 'true'
  742. }}
  743. artifact-verification-static: # Verify the static installer works with the consolidated artifacts.
  744. name: Test Consolidated Artifacts (Static)
  745. runs-on: ubuntu-latest
  746. needs:
  747. - prepare-upload
  748. - file-check
  749. services:
  750. apache: # This gets used to serve the static archives.
  751. image: httpd:2.4
  752. ports:
  753. - 8080:80
  754. volumes:
  755. - ${{ github.workspace }}:/usr/local/apache2/htdocs/
  756. steps:
  757. - name: Skip Check
  758. id: skip
  759. if: needs.file-check.outputs.run != 'true'
  760. run: echo "SKIPPED"
  761. - name: Checkout
  762. id: checkout
  763. if: needs.file-check.outputs.run == 'true'
  764. uses: actions/checkout@v4
  765. - name: Fetch artifacts
  766. id: fetch-artifacts
  767. if: needs.file-check.outputs.run == 'true'
  768. uses: Wandalen/wretry.action@v3
  769. with:
  770. action: actions/download-artifact@v4
  771. with: |
  772. name: final-artifacts
  773. path: artifacts
  774. attempt_limit: 3
  775. attempt_delay: 2000
  776. - name: Prepare artifacts directory
  777. id: prepare
  778. if: needs.file-check.outputs.run == 'true'
  779. run: |
  780. mkdir -p download/latest
  781. mv artifacts/* download/latest
  782. ls -al download/latest
  783. - name: Verify that artifacts work with installer
  784. id: verify
  785. if: needs.file-check.outputs.run == 'true'
  786. env:
  787. NETDATA_TARBALL_BASEURL: http://localhost:8080/
  788. run: packaging/installer/kickstart.sh --static-only --dont-start-it --disable-telemetry
  789. - name: Failure Notification
  790. uses: rtCamp/action-slack-notify@v2
  791. env:
  792. SLACK_COLOR: 'danger'
  793. SLACK_FOOTER: ''
  794. SLACK_ICON_EMOJI: ':github-actions:'
  795. SLACK_TITLE: 'Artifact verification for static build failed.'
  796. SLACK_USERNAME: 'GitHub Actions'
  797. SLACK_MESSAGE: |-
  798. ${{ github.repository }}: Artifact verification for static build failed.
  799. Checkout: ${{ steps.checkout.outcome }}
  800. Fetch artifacts: ${{ steps.fetch-artifacts.outcome }}
  801. Verify artifacts: ${{ steps.verify.outcome }}
  802. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  803. if: >-
  804. ${{
  805. failure()
  806. && startsWith(github.ref, 'refs/heads/master')
  807. && github.event_name != 'pull_request'
  808. && github.repository == 'netdata/netdata'
  809. && needs.file-check.outputs.run == 'true'
  810. }}
  811. upload-nightly: # Upload the nightly build artifacts to GCS.
  812. name: Upload Nightly Artifacts
  813. runs-on: ubuntu-latest
  814. if: github.event_name == 'workflow_dispatch' && github.event.inputs.type == 'nightly' && github.repository == 'netdata/netdata'
  815. needs:
  816. - artifact-verification-dist
  817. - artifact-verification-static
  818. steps:
  819. - name: Retrieve Artifacts
  820. id: fetch
  821. uses: Wandalen/wretry.action@v3
  822. with:
  823. action: actions/download-artifact@v4
  824. with: |
  825. name: final-artifacts
  826. path: final-artifacts
  827. attempt_limit: 3
  828. attempt_delay: 2000
  829. - name: Authenticate to GCS
  830. id: gcs-auth
  831. uses: google-github-actions/auth@v2
  832. with:
  833. project_id: ${{ secrets.GCP_NIGHTLY_STORAGE_PROJECT }}
  834. credentials_json: ${{ secrets.GCS_STORAGE_SERVICE_KEY_JSON }}
  835. - name: Setup GCS
  836. id: gcs-setup
  837. uses: google-github-actions/setup-gcloud@v2.1.0
  838. - name: Upload Artifacts
  839. id: upload
  840. uses: google-github-actions/upload-cloud-storage@v2.1.0
  841. with:
  842. destination: ${{ secrets.GCP_NIGHTLY_STORAGE_BUCKET }}
  843. gzip: false
  844. path: ./final-artifacts/latest-version.txt
  845. parent: false
  846. - name: Failure Notification
  847. uses: rtCamp/action-slack-notify@v2
  848. env:
  849. SLACK_COLOR: 'danger'
  850. SLACK_FOOTER: ''
  851. SLACK_ICON_EMOJI: ':github-actions:'
  852. SLACK_TITLE: 'Failed to upload nightly release artifacts:'
  853. SLACK_USERNAME: 'GitHub Actions'
  854. SLACK_MESSAGE: |-
  855. ${{ github.repository }}: Failed to upload nightly release artifacts.
  856. Fetch artifacts: ${{ steps.fetch.outcome }}
  857. Authenticatie GCS: ${{ steps.gcs-auth.outcome }}
  858. Setup GCS: ${{ steps.gcs-setup.outcome }}
  859. Upload artifacts: ${{ steps.upload.outcome }}
  860. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  861. if: >-
  862. ${{
  863. failure()
  864. && startsWith(github.ref, 'refs/heads/master')
  865. && github.event_name != 'pull_request'
  866. }}
  867. create-nightly: # Create a nightly build release in netdata/netdata-nightlies
  868. name: Create Nightly Release
  869. runs-on: ubuntu-latest
  870. if: github.event_name == 'workflow_dispatch' && github.event.inputs.type == 'nightly' && github.repository == 'netdata/netdata'
  871. needs:
  872. - artifact-verification-dist
  873. - artifact-verification-static
  874. steps:
  875. - name: Checkout Main Repo
  876. id: checkout-main
  877. uses: actions/checkout@v4
  878. with:
  879. path: main
  880. - name: Checkout Nightly Repo
  881. id: checkout-nightly
  882. uses: actions/checkout@v4
  883. with:
  884. repository: netdata/netdata-nightlies
  885. path: nightlies
  886. token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
  887. - name: Retrieve Artifacts
  888. id: fetch
  889. uses: Wandalen/wretry.action@v3
  890. with:
  891. action: actions/download-artifact@v4
  892. with: |
  893. name: final-artifacts
  894. path: final-artifacts
  895. attempt_limit: 3
  896. attempt_delay: 2000
  897. - name: Prepare version info
  898. id: version
  899. run: |
  900. # shellcheck disable=SC2129
  901. echo "version=$(cat main/packaging/version)" >> "${GITHUB_OUTPUT}"
  902. echo "commit=$(cd nightlies && git rev-parse HEAD)" >> "${GITHUB_OUTPUT}"
  903. echo "date=$(date +%F)" >> "${GITHUB_OUTPUT}"
  904. - name: Create Release
  905. id: create-release
  906. uses: ncipollo/release-action@v1
  907. with:
  908. allowUpdates: false
  909. artifactErrorsFailBuild: true
  910. artifacts: 'final-artifacts/sha256sums.txt,final-artifacts/netdata-*.tar.gz,final-artifacts/netdata-*.gz.run,final-artifacts/integrations.js'
  911. owner: netdata
  912. repo: netdata-nightlies
  913. body: Netdata nightly build for ${{ steps.version.outputs.date }}.
  914. commit: ${{ steps.version.outputs.commit }}
  915. makeLatest: true
  916. tag: ${{ steps.version.outputs.version }}
  917. token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
  918. - name: Checkout netdata main Repo # Checkout back to netdata/netdata repo to the update latest packaged versions
  919. id: checkout-netdata
  920. uses: actions/checkout@v4
  921. with:
  922. token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
  923. - name: Init python environment for publish release metadata
  924. uses: actions/setup-python@v5
  925. id: init-python
  926. with:
  927. python-version: "3.12"
  928. - name: Setup python environment
  929. id: setup-python
  930. run: |
  931. pip install -r .github/scripts/modules/requirements.txt
  932. - name: Check if the version is latest and published
  933. id: check-latest-version
  934. run: |
  935. python .github/scripts/check_latest_versions.py ${{ steps.version.outputs.version }}
  936. - name: SSH setup
  937. id: ssh-setup
  938. if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && steps.check-latest-version.outputs.versions_needs_update == 'true'
  939. uses: shimataro/ssh-key-action@v2
  940. with:
  941. key: ${{ secrets.NETDATABOT_PACKAGES_SSH_KEY }}
  942. name: id_ecdsa
  943. known_hosts: ${{ secrets.PACKAGES_KNOWN_HOSTS }}
  944. - name: Sync release info to packages.netdata.cloud
  945. id: sync-releases
  946. continue-on-error: true
  947. if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && steps.check-latest-version.outputs.versions_needs_update == 'true'
  948. run: |
  949. .github/scripts/upload-new-version-tags.sh packages.netdata.cloud
  950. - name: Sync release info to packages2.netdata.cloud
  951. id: sync-releases2
  952. if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && steps.check-latest-version.outputs.versions_needs_update == 'true'
  953. run: |
  954. .github/scripts/upload-new-version-tags.sh packages.netdata.cloud
  955. - name: Failure Notification
  956. uses: rtCamp/action-slack-notify@v2
  957. env:
  958. SLACK_COLOR: 'danger'
  959. SLACK_FOOTER: ''
  960. SLACK_ICON_EMOJI: ':github-actions:'
  961. SLACK_TITLE: 'Failed to draft release:'
  962. SLACK_USERNAME: 'GitHub Actions'
  963. SLACK_MESSAGE: |-
  964. ${{ github.repository }}: Failed to create nightly release or attach artifacts.
  965. Checkout netdata/netdata: ${{ steps.checkout-main.outcome }}
  966. Checkout netdata/netdata-nightlies: ${{ steps.checkout-nightly.outcome }}
  967. Fetch artifacts: ${{ steps.fetch.outcome }}
  968. Prepare version info: ${{ steps.version.outcome }}
  969. Create release: ${{ steps.create-release.outcome }}
  970. Checkout back netdata/netdata: ${{ steps.checkout-netdata.outcome }}
  971. Init python environment: ${{ steps.init-python.outcome }}
  972. Setup python environment: ${{ steps.setup-python.outcome }}
  973. Check the nearly published release against the advertised: ${{ steps.check-latest-version.outcome }}
  974. Setup ssh: ${{ steps.ssh-setup.outcome }}
  975. Sync release info to packages.netdata.cloud: ${{ steps.sync-releases.outcome }}
  976. Sync release info to packages2.netdata.cloud: ${{ steps.sync-releases2.outcome }}
  977. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  978. if: >-
  979. ${{
  980. failure()
  981. && github.event_name == 'workflow_dispatch'
  982. }}
  983. normalize-tag: # Fix the release tag if needed
  984. name: Normalize Release Tag
  985. runs-on: ubuntu-latest
  986. if: github.event_name == 'workflow_dispatch' && github.event.inputs.type == 'release'
  987. outputs:
  988. tag: ${{ steps.tag.outputs.tag }}
  989. steps:
  990. - name: Normalize Tag
  991. id: tag
  992. run: |
  993. if echo ${{ github.event.inputs.version }} | grep -qE '^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$'; then
  994. echo "tag=v${{ github.event.inputs.version }}" >> "${GITHUB_OUTPUT}"
  995. else
  996. echo "tag=${{ github.event.inputs.version }}" >> "${GITHUB_OUTPUT}"
  997. fi
  998. upload-release: # Create the draft release and upload the build artifacts.
  999. name: Create Release Draft
  1000. runs-on: ubuntu-latest
  1001. if: github.event_name == 'workflow_dispatch' && github.event.inputs.type == 'release' && github.repository == 'netdata/netdata'
  1002. needs:
  1003. - artifact-verification-dist
  1004. - artifact-verification-static
  1005. - normalize-tag
  1006. steps:
  1007. - name: Checkout
  1008. id: checkout
  1009. uses: actions/checkout@v4
  1010. - name: Retrieve Artifacts
  1011. id: fetch
  1012. uses: Wandalen/wretry.action@v3
  1013. with:
  1014. action: actions/download-artifact@v4
  1015. with: |
  1016. name: final-artifacts
  1017. path: final-artifacts
  1018. attempt_limit: 3
  1019. attempt_delay: 2000
  1020. - name: Create Release
  1021. id: create-release
  1022. uses: ncipollo/release-action@v1
  1023. with:
  1024. allowUpdates: false
  1025. artifactErrorsFailBuild: true
  1026. artifacts: 'final-artifacts/sha256sums.txt,final-artifacts/netdata-*.tar.gz,final-artifacts/netdata-*.gz.run,final-artifacts/integrations.js'
  1027. draft: true
  1028. tag: ${{ needs.normalize-tag.outputs.tag }}
  1029. token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
  1030. - name: Failure Notification
  1031. uses: rtCamp/action-slack-notify@v2
  1032. env:
  1033. SLACK_COLOR: 'danger'
  1034. SLACK_FOOTER: ''
  1035. SLACK_ICON_EMOJI: ':github-actions:'
  1036. SLACK_TITLE: 'Failed to draft release:'
  1037. SLACK_USERNAME: 'GitHub Actions'
  1038. SLACK_MESSAGE: |-
  1039. ${{ github.repository }}: Failed to create draft release or attach artifacts.
  1040. Checkout: ${{ steps.checkout.outcome }}
  1041. Fetch artifacts: ${{ steps.fetch.outcome }}
  1042. Create draft release: ${{ steps.create-release.outcome }}
  1043. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  1044. if: >-
  1045. ${{
  1046. failure()
  1047. && github.event_name == 'workflow_dispatch'
  1048. }}
  1049. - name: Success Notification
  1050. uses: rtCamp/action-slack-notify@v2
  1051. env:
  1052. SLACK_COLOR: 'good'
  1053. SLACK_FOOTER: ''
  1054. SLACK_ICON_EMOJI: ':github-actions:'
  1055. SLACK_TITLE: 'Created agent draft release:'
  1056. SLACK_USERNAME: 'GitHub Actions'
  1057. SLACK_MESSAGE: "${{ github.repository }}: ${{ steps.create-release.outputs.html_url }}"
  1058. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  1059. if: >-
  1060. ${{
  1061. success()
  1062. && github.event_name == 'workflow_dispatch'
  1063. }}