Skip to content

Commit 15bb021

Browse files
author
Kasper Peeters
committed
Add workflow to build Fedora 40 package on release event.
1 parent 940443b commit 15bb021

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Create a Fedora 40 package on a github release event.
2+
# This assumes that the cadabra version is the same as the
3+
# release name, and it will attempt to add the .rpm file
4+
# to the release assets.
5+
6+
name: Fedora-40 package
7+
8+
on: [release]
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-22.04
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
# - name: Exit if not on devel branch
19+
# if: github.ref != 'refs/heads/devel'
20+
# run: exit 1
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@master
24+
25+
- name: Pull Fedora image
26+
run: docker pull fedora:40
27+
28+
- name: Set up GitHub CLI
29+
run: |
30+
sudo apt-get update
31+
sudo apt-get install -y gh
32+
33+
- name: Authenticate GitHub CLI
34+
run: gh auth setup-git
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Build RPM in Fedora container
39+
run: |
40+
docker run --rm \
41+
-v ${{ github.workspace }}:/workspace \
42+
-w /workspace \
43+
fedora:40 \
44+
bash -c "
45+
git config --global --add safe.directory /workspace
46+
dnf install -y rpm-build make gcc-c++ git python3-devel cmake gmp-devel libuuid-devel sqlite-devel gtkmm30-devel boost-devel python3-matplotlib python3-pip
47+
pip3 install sympy
48+
mkdir build
49+
cd build
50+
cmake -DPACKAGING_MODE=ON -DENABLE_MATHEMATICA=OFF -DCMAKE_INSTALL_PREFIX=/usr ..
51+
make
52+
cpack
53+
"
54+
55+
- name: Set version variables from output of cmake
56+
run: |
57+
VER=$(cat ${{ github.workspace }}/build/VERSION)
58+
echo "VERSION=$VER" >> $GITHUB_ENV
59+
60+
- name: Upload Release Assets
61+
run: |
62+
gh release upload "${{ env.VERSION }}" build/cadabra2-${{ env.VERSION }}-fedora40.rpm --clobber
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+

cmake/packaging.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ if(EXISTS "/etc/redhat-release")
5252
message("-- This is a Fedora 35 system")
5353
set(CPACK_RPM_PACKAGE_REQUIRES "python3-libs, gmp, libuuid, sqlite, gtkmm30, boost-system, boost-filesystem, boost-program-options, boost-regex, libstdc++, python3-matplotlib, python3-sympy, dvipng, texlive, texlive-ytableau")
5454
set(CPACK_SYSTEM_NAME "fedora35")
55+
elseif(LINUX_ISSUE MATCHES "40")
56+
message("-- This is a Fedora 40 system")
57+
set(CPACK_RPM_PACKAGE_REQUIRES "python3-libs, gmp, libuuid, sqlite, gtkmm30, boost-system, boost-filesystem, boost-program-options, boost-regex, libstdc++, python3-matplotlib, python3-sympy")
58+
set(CPACK_SYSTEM_NAME "fedora40")
5559
elseif(LINUX_ISSUE MATCHES "24")
5660
message("-- This is a Fedora 24 system")
5761
set(CPACK_RPM_PACKAGE_REQUIRES "python3-libs, gmp, libuuid, sqlite, gtkmm30, boost-system, boost-filesystem, boost-program-options, boost-regex, libstdc++, python3-matplotlib, dvipng, texlive, texlive-ytableau")

0 commit comments

Comments
 (0)