69 lines
4.4 KiB
YAML
69 lines
4.4 KiB
YAML
---
|
|
# Handles building of binary packages for the agent.
|
|
name: Repository Packages
|
|
on:
|
|
workflow_dispatch: null
|
|
env:
|
|
DO_NOT_TRACK: 1
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
DO_NOT_TRACK: 1
|
|
DOCKER_CLI_EXPERIMENTAL: enabled
|
|
strategy:
|
|
# This needs to be kept in sync with the matrix in packaging.yml, but should only include the AMD64 lines.
|
|
matrix:
|
|
include:
|
|
- {distro: debian, version: "9", pkgclouddistro: debian/stretch, format: deb, base_image: debian, platform: linux/amd64, arch: amd64}
|
|
- {distro: debian, version: "10", pkgclouddistro: debian/buster, format: deb, base_image: debian, platform: linux/amd64, arch: amd64}
|
|
- {distro: debian, version: "11", pkgclouddistro: debian/bullseye, format: deb, base_image: debian, platform: linux/amd64, arch: amd64}
|
|
- {distro: ubuntu, version: "18.04", pkgclouddistro: ubuntu/bionic, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64}
|
|
- {distro: ubuntu, version: "20.04", pkgclouddistro: ubuntu/focal, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64}
|
|
- {distro: ubuntu, version: "21.04", pkgclouddistro: ubuntu/hirsute, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64}
|
|
- {distro: centos, version: "7", pkgclouddistro: el/7, format: rpm, base_image: centos, platform: linux/amd64, arch: amd64}
|
|
- {distro: centos, version: "8", pkgclouddistro: el/8, format: rpm, base_image: centos, platform: linux/amd64, arch: amd64}
|
|
- {distro: fedora, version: "33", pkgclouddistro: fedora/33, format: rpm, base_image: fedora, platform: linux/amd64, arch: amd64}
|
|
- {distro: fedora, version: "34", pkgclouddistro: fedora/34, format: rpm, base_image: fedora, platform: linux/amd64, arch: amd64}
|
|
- {distro: opensuse, version: "15.2", pkgclouddistro: opensuse/15.2, format: rpm, base_image: opensuse/leap, platform: linux/amd64, arch: amd64}
|
|
- {distro: opensuse, version: "15.3", pkgclouddistro: opensuse/15.3, format: rpm, base_image: opensuse/leap, platform: linux/amd64, arch: amd64}
|
|
# We intentiaonally disable the fail-fast behavior so that a
|
|
# build failure for one version doesn't prevent us from publishing
|
|
# successfully built and tested packages for another version.
|
|
fail-fast: false
|
|
max-parallel: 8
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
# Unlike normally, we do not need a deep clone or submodules for this.
|
|
- name: Build Packages
|
|
shell: bash
|
|
run: |
|
|
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
|
|
- name: Upload Packages
|
|
shell: bash
|
|
env:
|
|
PKG_CLOUD_TOKEN: ${{ secrets.PACKAGE_CLOUD_API_KEY }}
|
|
run: |
|
|
echo "Packages to upload:\n$(ls artifacts/*.${{ matrix.format }})"
|
|
for pkgfile in artifacts/*.${{ matrix.format }} ; do
|
|
.github/scripts/package_cloud_wrapper.sh yank ${{ secrets.PACKAGE_CLOUD_REPO }}/${{ matrix.pkgclouddistro }} $(basename ${pkgfile}) || true
|
|
.github/scripts/package_cloud_wrapper.sh push ${{ secrets.PACKAGE_CLOUD_REPO }}/${{ matrix.pkgclouddistro }} ${pkgfile}
|
|
.github/scripts/package_cloud_wrapper.sh yank ${{ secrets.PACKAGE_CLOUD_REPO }}-edge/${{ matrix.pkgclouddistro }} $(basename ${pkgfile}) || true
|
|
.github/scripts/package_cloud_wrapper.sh push ${{ secrets.PACKAGE_CLOUD_REPO }}-edge/${{ matrix.pkgclouddistro }} ${pkgfile}
|
|
.github/scripts/package_cloud_wrapper.sh yank ${{ secrets.PACKAGE_CLOUD_REPO }}-repoconfig/${{ matrix.pkgclouddistro }} $(basename ${pkgfile}) || true
|
|
.github/scripts/package_cloud_wrapper.sh push ${{ secrets.PACKAGE_CLOUD_REPO }}-repoconfig/${{ matrix.pkgclouddistro }} ${pkgfile}
|
|
done
|
|
- name: Failure Notification
|
|
if: ${{ failure() }}
|
|
uses: rtCamp/action-slack-notify@v2
|
|
env:
|
|
SLACK_COLOR: 'danger'
|
|
SLACK_FOOTER: ''
|
|
SLACK_ICON_EMOJI: ':github-actions:'
|
|
SLACK_TITLE: 'Repository Package Build failed:'
|
|
SLACK_USERNAME: 'GitHub Actions'
|
|
SLACK_MESSAGE: "${{ matrix.pkgclouddistro }} ${{ matrix.version }} repository package build failed."
|
|
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
|