repoconfig-packages.yml 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. ---
  2. # Handles building of binary packages for the agent.
  3. name: Repository Packages
  4. on:
  5. workflow_dispatch: null
  6. env:
  7. DO_NOT_TRACK: 1
  8. jobs:
  9. build:
  10. name: Build
  11. runs-on: ubuntu-latest
  12. env:
  13. DO_NOT_TRACK: 1
  14. DOCKER_CLI_EXPERIMENTAL: enabled
  15. strategy:
  16. # This needs to be kept in sync with the matrix in packaging.yml, but should only include the AMD64 lines.
  17. matrix:
  18. include:
  19. - {distro: debian, version: "9", pkgclouddistro: debian/stretch, format: deb, base_image: debian, platform: linux/amd64, arch: amd64}
  20. - {distro: debian, version: "10", pkgclouddistro: debian/buster, format: deb, base_image: debian, platform: linux/amd64, arch: amd64}
  21. - {distro: debian, version: "11", pkgclouddistro: debian/bullseye, format: deb, base_image: debian, platform: linux/amd64, arch: amd64}
  22. - {distro: ubuntu, version: "18.04", pkgclouddistro: ubuntu/bionic, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64}
  23. - {distro: ubuntu, version: "20.04", pkgclouddistro: ubuntu/focal, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64}
  24. - {distro: ubuntu, version: "21.04", pkgclouddistro: ubuntu/hirsute, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64}
  25. - {distro: centos, version: "7", pkgclouddistro: el/7, format: rpm, base_image: centos, platform: linux/amd64, arch: amd64}
  26. - {distro: centos, version: "8", pkgclouddistro: el/8, format: rpm, base_image: centos, platform: linux/amd64, arch: amd64}
  27. - {distro: fedora, version: "33", pkgclouddistro: fedora/33, format: rpm, base_image: fedora, platform: linux/amd64, arch: amd64}
  28. - {distro: fedora, version: "34", pkgclouddistro: fedora/34, format: rpm, base_image: fedora, platform: linux/amd64, arch: amd64}
  29. - {distro: opensuse, version: "15.2", pkgclouddistro: opensuse/15.2, format: rpm, base_image: opensuse/leap, platform: linux/amd64, arch: amd64}
  30. - {distro: opensuse, version: "15.3", pkgclouddistro: opensuse/15.3, format: rpm, base_image: opensuse/leap, platform: linux/amd64, arch: amd64}
  31. # We intentiaonally disable the fail-fast behavior so that a
  32. # build failure for one version doesn't prevent us from publishing
  33. # successfully built and tested packages for another version.
  34. fail-fast: false
  35. max-parallel: 8
  36. steps:
  37. - name: Checkout
  38. uses: actions/checkout@v2
  39. # Unlike normally, we do not need a deep clone or submodules for this.
  40. - name: Build Packages
  41. shell: bash
  42. run: |
  43. docker run -e DO_NOT_TRACK=1 --platform ${{ matrix.platform }} -v $PWD:/netdata ${{ matrix.base_image }}:${{ matrix.version }} /netdata/packaging/repoconfig/build-${{ matrix.format }}.sh
  44. - name: Upload Packages
  45. shell: bash
  46. env:
  47. PKG_CLOUD_TOKEN: ${{ secrets.PACKAGE_CLOUD_API_KEY }}
  48. run: |
  49. echo "Packages to upload:\n$(ls artifacts/*.${{ matrix.format }})"
  50. for pkgfile in artifacts/*.${{ matrix.format }} ; do
  51. .github/scripts/package_cloud_wrapper.sh yank ${{ secrets.PACKAGE_CLOUD_REPO }}/${{ matrix.pkgclouddistro }} $(basename ${pkgfile}) || true
  52. .github/scripts/package_cloud_wrapper.sh push ${{ secrets.PACKAGE_CLOUD_REPO }}/${{ matrix.pkgclouddistro }} ${pkgfile}
  53. .github/scripts/package_cloud_wrapper.sh yank ${{ secrets.PACKAGE_CLOUD_REPO }}-edge/${{ matrix.pkgclouddistro }} $(basename ${pkgfile}) || true
  54. .github/scripts/package_cloud_wrapper.sh push ${{ secrets.PACKAGE_CLOUD_REPO }}-edge/${{ matrix.pkgclouddistro }} ${pkgfile}
  55. .github/scripts/package_cloud_wrapper.sh yank ${{ secrets.PACKAGE_CLOUD_REPO }}-repoconfig/${{ matrix.pkgclouddistro }} $(basename ${pkgfile}) || true
  56. .github/scripts/package_cloud_wrapper.sh push ${{ secrets.PACKAGE_CLOUD_REPO }}-repoconfig/${{ matrix.pkgclouddistro }} ${pkgfile}
  57. done
  58. - name: Failure Notification
  59. if: ${{ failure() }}
  60. uses: rtCamp/action-slack-notify@v2
  61. env:
  62. SLACK_COLOR: 'danger'
  63. SLACK_FOOTER: ''
  64. SLACK_ICON_EMOJI: ':github-actions:'
  65. SLACK_TITLE: 'Repository Package Build failed:'
  66. SLACK_USERNAME: 'GitHub Actions'
  67. SLACK_MESSAGE: "${{ matrix.pkgclouddistro }} ${{ matrix.version }} repository package build failed."
  68. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}