Skip to content

Commit 837bb63

Browse files
author
Kasper Peeters
committed
Fix merge
2 parents 15bb021 + bec0b37 commit 837bb63

26 files changed

+717
-341
lines changed

.github/workflows/appimage.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Create AppImages on a github release event. This assumes that the
2+
# cadabra version is the same as the release name, and it will attempt
3+
# to add the .AppImage files to the release assets.
4+
5+
name: AppImage
6+
7+
on: [release]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-20.04
12+
name: AppImage on ${{ matrix.arch }}
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
include:
18+
- arch: x86_64
19+
distro: ubuntu20.04
20+
# - arch: aarch64
21+
# distro: ubuntu20.04
22+
23+
steps:
24+
- name: Setup GitHub CLI
25+
run: |
26+
sudo apt-get update
27+
sudo apt-get install -y gh
28+
29+
- name: Authenticate GitHub CLI
30+
run: gh auth setup-git
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- uses: actions/checkout@master
35+
name: Checkout source
36+
37+
- name: Native build
38+
if: ${{ contains(matrix.arch, 'x86') }}
39+
id: build-native
40+
run: |
41+
sudo apt update -q -y
42+
sudo DEBIAN_FRONTEND=noninteractive apt install -y git cmake python3-dev python3-pip g++ libpcre3 libpcre3-dev libgmp3-dev libgtkmm-3.0-dev libboost-all-dev libgmp-dev libsqlite3-dev uuid-dev libmpfr-dev libmpc-dev && python3 --version && which python3 && python3 -m pip install --upgrade pip && python3 -m pip install wheel && python3 -m pip install sympy gmpy2 numpy
43+
mkdir build
44+
cd build
45+
cmake -DENABLE_MATHEMATICA=OFF -DAPPIMAGE_MODE=ON -DCMAKE_INSTALL_PREFIX=/usr ..
46+
make
47+
make install DESTDIR=AppDir
48+
make appimage
49+
mkdir -p ${{ github.workspace }}/artifacts
50+
cp Cadabra*.AppImage ${{ github.workspace }}/artifacts
51+
52+
- name: QEMU build ${{ matrix.arch }}
53+
if: ${{ !contains(matrix.arch, 'x86') }}
54+
uses: uraimo/run-on-arch-action@master
55+
id: build
56+
with:
57+
arch: ${{ matrix.arch }}
58+
distro: ${{ matrix.distro }}
59+
githubToken: ${{ github.token }}
60+
setup: |
61+
mkdir -p ${{ github.workspace }}/artifacts
62+
63+
dockerRunArgs:
64+
--volume "${{ github.workspace }}/artifacts:/artifacts"
65+
66+
shell: /bin/sh
67+
68+
install: |
69+
apt update -q -y
70+
DEBIAN_FRONTEND=noninteractive apt install -y git wget gpg
71+
# Get current cmake (we need at least 3.21 for linuxdeploy)
72+
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
73+
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
74+
apt update -y
75+
apt install -y kitware-archive-keyring
76+
apt install -y cmake
77+
apt upgrade -y
78+
cmake --version
79+
# Install the rest.
80+
DEBIAN_FRONTEND=noninteractive apt install -y git cmake python3-dev python3-pip g++ libpcre3 libpcre3-dev libgmp3-dev libgtkmm-3.0-dev libboost-all-dev libgmp-dev libsqlite3-dev uuid-dev libmpfr-dev libmpc-dev python3-gmpy2 && python3 --version && which python3 && python3 -m pip install --upgrade pip && python3 -m pip install wheel && python3 -m pip install sympy numpy
81+
DEBIAN_FRONTEND=noninteractive apt install -y cimg-dev libgtest-dev ca-certificates libgpgme-dev libssh-gcrypt-dev libcurl4-gnutls-dev patchelf squashfs-tools desktop-file-utils
82+
# Build appimagetool, linuxdeploy and linuxdeploy-plugin-appimage, as we
83+
# cannot run the linuxdeploy.AppImage inside QEMU.
84+
mkdir linuxdeploy
85+
cd linuxdeploy
86+
git clone https://github.com/AppImage/appimagetool.git --recurse-submodules
87+
git clone https://github.com/linuxdeploy/linuxdeploy.git --recurse-submodules
88+
git clone https://github.com/linuxdeploy/linuxdeploy-plugin-appimage.git --recurse-submodules
89+
(cd appimagetool && mkdir build && cd build && cmake .. && make install)
90+
(cd linuxdeploy && mkdir build && cd build && cmake -DBUILD_TESTING=OFF .. && make install)
91+
(cd linuxdeploy-plugin-appimage && mkdir build && cd build && cmake -DBUILD_TESTING=OFF .. && make install)
92+
93+
run: |
94+
mkdir build
95+
cd build
96+
git config --global --add safe.directory /home/runner/work/cadabra2/cadabra2
97+
cmake -DENABLE_MATHEMATICA=OFF -DAPPIMAGE_MODE=ON -DCMAKE_INSTALL_PREFIX=/usr ..
98+
make
99+
make install DESTDIR=AppDir
100+
make appimage
101+
cp Cadabra*.AppImage /artifacts
102+
103+
- name: Set version variables from output of cmake
104+
run: |
105+
VER=$(cat ${{ github.workspace }}/build/VERSION)
106+
echo "VERSION=$VER" >> $GITHUB_ENV
107+
108+
- name: Upload release assets
109+
run: |
110+
ls ${{ github.workspace }}/artifacts/
111+
gh release upload "${{ env.VERSION }}" ${{ github.workspace }}/artifacts/Cadabra_${{ env.VERSION }}_${{ matrix.arch }}.AppImage --clobber
112+
env:
113+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114+

.github/workflows/linux.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v3
1212

13-
- name: Exit if not on devel branch
14-
if: github.ref != 'refs/heads/devel'
15-
run: exit 1
13+
# - name: Exit if not on devel branch
14+
# if: github.ref != 'refs/heads/devel'
15+
# run: exit 1
1616

1717
- name: setup python
1818
uses: actions/setup-python@v4

.github/workflows/macos.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v4
1212

13-
- name: Exit if not on devel branch
14-
if: github.ref != 'refs/heads/devel'
15-
run: exit 1
13+
# - name: Exit if not on devel branch
14+
# if: github.ref != 'refs/heads/devel'
15+
# run: exit 1
1616

1717
- name: setup python
1818
uses: actions/setup-python@v5
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Create a OpenSUSE Leap 15 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: OpenSUSE-Leap-15 package
7+
8+
on: [push]
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 OpenSUSE image
26+
run: docker pull opensuse/leap:15
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
39+
run: |
40+
docker run --rm \
41+
-v ${{ github.workspace }}:/workspace \
42+
-w /workspace \
43+
opensuse/leap:15 \
44+
bash -c "
45+
zypper -n install --no-recommends git cmake python311-devel gcc-c++ \
46+
gmp-devel libuuid-devel \
47+
gtkmm3-devel \
48+
python311-matplotlib \
49+
libboost_system1_66_0-devel libboost_filesystem1_66_0-devel \
50+
libboost_date_time1_66_0-devel libboost_program_options1_66_0-devel
51+
git config --global --add safe.directory /workspace
52+
mkdir build
53+
cd build
54+
cmake -DPACKAGING_MODE=ON -DENABLE_MATHEMATICA=OFF -DCMAKE_INSTALL_PREFIX=/usr ..
55+
make
56+
cpack
57+
"
58+
59+
- name: Set version variables from output of cmake
60+
run: |
61+
VER=$(cat ${{ github.workspace }}/build/VERSION)
62+
echo "VERSION=$VER" >> $GITHUB_ENV
63+
64+
- name: Upload Release Assets
65+
run: |
66+
gh release upload "${{ env.VERSION }}" build/cadabra2-${{ env.VERSION }}-leap15.rpm --clobber
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Create a OpenSUSE Tumbleweed 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: OpenSUSE-Tumbleweed 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 OpenSUSE image
26+
run: docker pull opensuse/tumbleweed:latest
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
39+
run: |
40+
docker run --rm \
41+
-v ${{ github.workspace }}:/workspace \
42+
-w /workspace \
43+
opensuse/tumbleweed:latest \
44+
bash -c "
45+
zypper refresh
46+
zypper update
47+
zypper -n install --no-recommends rpmbuild git cmake python311-devel gcc-c++ \
48+
gmp-devel libuuid-devel \
49+
gtkmm3-devel sqlite3-devel \
50+
python311-matplotlib \
51+
libboost_system-devel libboost_filesystem-devel \
52+
libboost_date_time-devel libboost_program_options-devel
53+
git config --global --add safe.directory /workspace
54+
mkdir build
55+
cd build
56+
cmake -DPACKAGING_MODE=ON -DENABLE_MATHEMATICA=OFF -DCMAKE_INSTALL_PREFIX=/usr ..
57+
make
58+
cpack
59+
"
60+
61+
- name: Set version variables from output of cmake
62+
run: |
63+
VER=$(cat ${{ github.workspace }}/build/VERSION)
64+
echo "VERSION=$VER" >> $GITHUB_ENV
65+
66+
- name: Upload Release Assets
67+
run: |
68+
gh release upload "${{ env.VERSION }}" build/cadabra2-${{ env.VERSION }}-tumbleweed.rpm --clobber
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+

.github/workflows/ubuntu-package.yml renamed to .github/workflows/ubuntu-22.04-package.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
name: Ubuntu-22.04 package
77

8-
on: [release]
8+
on: [push]
99

1010
jobs:
1111
build:
@@ -53,13 +53,8 @@ jobs:
5353
5454
- name: Upload Release Assets
5555
run: |
56-
gh release upload "${{ env.VERSION }}" build/cadabra2-${{ env.VERSION }}-jammy.deb --clobber
56+
gh release upload "${{ env.VERSION }}" build/cadabra2-${{ env.VERSION }}-ubuntu-22.04-jammy.deb --clobber
5757
env:
5858
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5959

60-
# - name: Upload artifact to github assets
61-
# uses: actions/upload-artifact@main
62-
# with:
63-
# name: cadabra2-${{ env.VERSION }}-jammy.deb
64-
# path: build/cadabra2-${{ env.VERSION }}-jammy.deb
6560

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Create an Ubuntu 24.04 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 .deb file
4+
# to the release assets.
5+
6+
name: Ubuntu-24.04 package
7+
8+
on: [push]
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-24.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: setup python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: 3.12
26+
27+
- name: Set up GitHub CLI
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install -y gh
31+
32+
- name: Authenticate GitHub CLI
33+
run: gh auth setup-git
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Get dependencies
38+
run: sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive apt-get install git cmake python3-dev g++ libpcre3 libpcre3-dev libgmp3-dev libgtkmm-3.0-dev libboost-all-dev libgmp-dev libsqlite3-dev uuid-dev libmpfr-dev libmpc-dev && python3 --version && which python3 && python3 -m pip install --upgrade pip && python3 -m pip install wheel && python3 -m pip install sympy gmpy2 numpy
39+
40+
- name: configure
41+
run: mkdir build && cd build && cmake -DPACKAGING_MODE=ON -DENABLE_MATHEMATICA=OFF -DCMAKE_INSTALL_PREFIX=/usr ..
42+
43+
- name: Make
44+
run: cd build && make
45+
46+
- name: Create the .deb package
47+
run: cd build && cpack
48+
49+
- name: Set version variables from output of cmake
50+
run: |
51+
VER=$(cat build/VERSION)
52+
echo "VERSION=$VER" >> $GITHUB_ENV
53+
54+
- name: Upload Release Assets
55+
run: |
56+
gh release upload "${{ env.VERSION }}" build/cadabra2-${{ env.VERSION }}-ubuntu-24.04-noble.deb --clobber
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
60+

0 commit comments

Comments
 (0)