generated from EGI-Federation/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f8a170d
commit b39a46f
Showing
4 changed files
with
201 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
name: Create packages and test installation | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
centos7: | ||
name: Build CentOS 7 RPMs | ||
runs-on: ubuntu-latest | ||
container: quay.io/centos/centos:7 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install build requisites | ||
run: | | ||
yum install -y cmake rpm-build rpmlint make rsync | ||
- name: build rpm | ||
run: | | ||
make rpm | ||
- name: Upload rpms | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: rpms7 | ||
path: | | ||
build/RPMS/noarch/nagios-*.el7.noarch.rpm | ||
build-almalinux9: | ||
name: Build AlmaLinux 9 RPMs | ||
runs-on: ubuntu-latest | ||
container: almalinux:9 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install build requisites | ||
run: | | ||
dnf install -y rpm-build cmake rpmlint make rsync systemd-rpm-macros | ||
- name: build rpm | ||
run: | | ||
make rpm | ||
- name: Upload RPMs | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: rpms9 | ||
path: | | ||
build/RPMS/noarch/nagios-*.el9.noarch.rpm | ||
centos7-install: | ||
name: Install CentOS 7 RPMs | ||
needs: centos7 | ||
runs-on: ubuntu-latest | ||
container: quay.io/centos/centos:7 | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: rpms7 | ||
- name: Install generated RPMs | ||
run: | | ||
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm | ||
yum install -y http://repository.egi.eu/sw/production/umd/4/centos7/x86_64/updates/umd-release-4.1.3-1.el7.centos.noarch.rpm | ||
yum localinstall -y nagios-*.rpm | ||
install-almalinux9: | ||
name: Install AlmaLinux 9 RPMs | ||
needs: build-almalinux9 | ||
runs-on: ubuntu-latest | ||
container: almalinux:9 | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: rpms9 | ||
- name: Install generated RPMs | ||
run: | | ||
# FIXME: remove external repo when UMD5 is available | ||
dnf install -y epel-release | ||
dnf localinstall -y https://github.com/EGI-Federation/nagios-plugins-srm/raw/master/python3-nap-0.1.21-2.el9.noarch.rpm | ||
dnf localinstall -y nagios-*.rpm |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
--- | ||
# When a tag is created | ||
# - create a new release from the tag | ||
# - build and attach packages to the release | ||
name: Create packages and release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
centos7: | ||
name: Build centOS 7 RPMs | ||
runs-on: ubuntu-latest | ||
container: centos:7 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: install build requisites | ||
run: | | ||
yum install -y rpm-build rpmlint make rsync | ||
- name: build rpm | ||
run: | | ||
make rpm | ||
rpmlint --file .rpmlint.ini build/RPMS/noarch/*.rpm | ||
- name: Upload rpms | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: rpms7 | ||
path: | | ||
build/RPMS/noarch/nagios-*.el7.noarch.rpm | ||
build/SRPMS/nagios-*.el7.src.rpm | ||
almalinux9: | ||
name: Build AlmaLinux 9 RPMs | ||
runs-on: ubuntu-latest | ||
container: almalinux:9 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install build requisites | ||
run: | | ||
dnf install -y rpm-build make rsync systemd-rpm-macros | ||
- name: build rpm | ||
run: | | ||
make clean rpm | ||
- name: Upload RPMs | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: rpms9 | ||
path: | | ||
build/RPMS/noarch/nagios-*.el9.noarch.rpm | ||
build/SRPMS/nagios-*.el9.src.rpm | ||
release7: | ||
name: Upload CentOS 7 release artefacts | ||
needs: centos7 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: rpms7 | ||
|
||
- name: Find package name | ||
id: package_name_centos7 | ||
run: | | ||
rpm_path=$(find . -name 'nagios-*.el7.noarch.rpm') | ||
src_path=$(find . -name 'nagios-*.el7.src.rpm') | ||
echo "rpm_path=${rpm_path}" >> "$GITHUB_OUTPUT" | ||
echo "src_path=${src_path}" >> "$GITHUB_OUTPUT" | ||
- name: Attach CentOS 7 RPMs to the release | ||
uses: softprops/action-gh-release@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
fail_on_unmatched_files: true | ||
files: | | ||
${{ steps.package_name_centos7.outputs.rpm_path }} | ||
${{ steps.package_name_centos7.outputs.src_path }} | ||
release9: | ||
name: Upload AlmaLinux 9 release artefacts | ||
permissions: | ||
contents: write # to upload release asset (softprops/action-gh-release) | ||
needs: almalinux9 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: rpms9 | ||
- name: Find package name | ||
id: package_name_almalinux9 | ||
run: | | ||
rpm_path=$(find . -name 'nagios-*.el9.noarch.rpm') | ||
src_path=$(find . -name 'nagios-*.el9.src.rpm') | ||
echo "rpm_path=${rpm_path}" >> "$GITHUB_OUTPUT" | ||
echo "src_path=${src_path}" >> "$GITHUB_OUTPUT" | ||
- name: Attach AlmaLinux 9 RPMs to the release | ||
uses: softprops/action-gh-release@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
fail_on_unmatched_files: true | ||
files: | | ||
${{ steps.package_name_almalinux9.outputs.rpm_path }} | ||
${{ steps.package_name_almalinux9.outputs.src_path }} |