Merge branch 'v3_8' #71
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-License-Identifier: BSD-3-Clause | |
# (c) Copyright 2024 Advanced Micro Devices, Inc. | |
name: "Create test packages" | |
on: | |
workflow_dispatch: | |
push: | |
branches: [master, v3_7] | |
tags: [v*, sfptpd-*] | |
permissions: | |
contents: read | |
jobs: | |
rpm: | |
strategy: | |
max-parallel: 2 | |
matrix: | |
dist: [el9, el8] | |
include: | |
- dist: el9 | |
build_os: almalinux/9 | |
extra_build_deps: systemd-rpm-macros | |
- dist: el8 | |
build_os: almalinux/8 | |
extra_build_deps: systemd-rpm-macros | |
runs-on: ubuntu-latest | |
env: | |
BUILD_DEPS: rpm-build git gcc make libmnl-devel libcap-devel python3-devel | |
container: | |
image: ghcr.io/${{ matrix.build_os }}-base:latest | |
steps: | |
- name: enable extra repositories | |
if: ${{ matrix.build_os == 'almalinux/9' }} | |
run: yum install -y 'dnf-command(config-manager)' && yum config-manager --set-enabled crb | |
- name: install build prerequisites | |
run: yum --setopt install_weak_deps=0 install -y ${BUILD_DEPS} ${{ matrix.extra_build_deps }} | |
- name: checkout sfptpd | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: build srpm | |
run: | | |
set -o pipefail | |
git config --global --add safe.directory $(pwd) | |
make RPM_OSVER=${{ matrix.dist }} build_srpm | tee transcript && sed -n s,^ENV:,,p transcript >> "$GITHUB_ENV" | |
- name: publish srpm | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sfptpd-${{ env.SFPTPD_VERSION }}-${{ matrix.dist }}-srpm | |
path: ~/rpmbuild/SRPMS/ | |
if-no-files-found: error | |
- name: build rpm | |
run: rpmbuild --rebuild ${{ env.SFPTPD_SRPMS }} | |
- name: publish rpms | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sfptpd-${{ env.SFPTPD_VERSION }}-${{ matrix.dist }}-rpms | |
path: ~/rpmbuild/RPMS/ | |
if-no-files-found: error | |
bin-tgz: | |
name: binary tarball | |
runs-on: ubuntu-latest | |
env: | |
BUILD_DEPS: gcc git make libmnl-devel libcap-devel | |
container: | |
image: ghcr.io/almalinux/8-base:latest | |
steps: | |
- name: install build prerequisites | |
run: yum install -y ${BUILD_DEPS} | |
- name: checkout sfptpd | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: build binary | |
run: | | |
git config --global --add safe.directory $(pwd) | |
make patch_version | |
SFPTPD_ARCH=$(uname -i) | |
SFPTPD_VERSION=$(scripts/sfptpd_versioning read) | |
SFPTPD_STAGING=sfptpd-${SFPTPD_VERSION}.${SFPTPD_ARCH} | |
make flat_install DESTDIR=${SFPTPD_STAGING} EXTRA_CFLAGS="-O2" | |
echo 'Built on EL8 to support glibc 2.28 or later' > README.ThisBuild | |
mkdir TGZ | |
tar cvzf TGZ/${SFPTPD_STAGING}.tgz ${SFPTPD_STAGING} README.ThisBuild | |
printf "SFPTPD_VERSION=$SFPTPD_VERSION" >> "$GITHUB_ENV" | |
- name: publish binary archive | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sfptpd-${{ env.SFPTPD_VERSION }}-bin | |
path: TGZ | |
if-no-files-found: error | |
deb: | |
name: debian packages | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: sfptpd_checkout | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y devscripts debhelper dh-python equivs | |
sudo mk-build-deps -t "apt -y" -i | |
- name: build | |
run: | | |
debuild -i -us -uc -b | |
SFPTPD_VERSION=$(scripts/sfptpd_versioning read) | |
SFPTPD_STAGING=sfptpd-${SFPTPD_VERSION}-ubu20.04 | |
mkdir DEB | |
cp ../*deb DEB | |
printf "SFPTPD_VERSION=$SFPTPD_VERSION" >> "$GITHUB_ENV" | |
- name: publish debian packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sfptpd-${{ env.SFPTPD_VERSION }}-deb | |
path: DEB | |
if-no-files-found: error |