-
Notifications
You must be signed in to change notification settings - Fork 37
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
Showing
2 changed files
with
66 additions
and
1 deletion.
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,65 @@ | ||
# Create an Ubuntu 22.04 package on a github release event. | ||
# This assumes that the cadabra version is the same as the | ||
# release name, and it will attempt to add the .deb file | ||
# to the release assets. | ||
|
||
name: Ubuntu-22.04 package | ||
|
||
on: [release] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
# - name: Exit if not on devel branch | ||
# if: github.ref != 'refs/heads/devel' | ||
# run: exit 1 | ||
|
||
- name: setup python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Set up GitHub CLI | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y gh | ||
- name: Authenticate GitHub CLI | ||
run: gh auth setup-git | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get dependencies | ||
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 | ||
|
||
- name: configure | ||
run: mkdir build && cd build && cmake -DPACKAGING_MODE=ON -DENABLE_MATHEMATICA=OFF -DCMAKE_INSTALL_PREFIX=/usr .. | ||
|
||
- name: Make | ||
run: cd build && make | ||
|
||
- name: Create the .deb package | ||
run: cd build && cpack | ||
|
||
- name: Set version variables from output of cmake | ||
run: | | ||
VER=$(cat build/VERSION) | ||
echo "VERSION=$VER" >> $GITHUB_ENV | ||
- name: Upload Release Assets | ||
run: | | ||
gh release upload "${{ env.VERSION }}" build/cadabra2-${{ env.VERSION }}-jammy.deb --clobber | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# - name: Upload artifact to github assets | ||
# uses: actions/upload-artifact@main | ||
# with: | ||
# name: cadabra2-${{ env.VERSION }}-jammy.deb | ||
# path: build/cadabra2-${{ env.VERSION }}-jammy.deb | ||
|
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