Skip to content

Commit

Permalink
Fix workflow run triggers. Update windows build flow.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasper Peeters committed Sep 26, 2024
1 parent 21bed1a commit 1193e1a
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 18 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

name: AppImage

on: [release]
on:
release:
types: [created]

jobs:
build:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

name: Docker

on: [release]
on:
release:
types: [created]

jobs:
build:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/fedora-40-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

name: Fedora-40 package

on: [release]
on:
release:
types: [created]

jobs:
build:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This is a build which gets triggered on every commit push, to
# ensure that we get some warnings when we push code that does
# not build on Linux.

name: Linux

on: [push]
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This is a build which gets triggered on every commit push, to
# ensure that we get some warnings when we push code that does
# not build on macOS.

name: macOS

on: [push]
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/opensuse-tumbleweed-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

name: OpenSUSE-Tumbleweed package

on: [release]
on:
release:
types: [created]

jobs:
build:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ubuntu-22.04-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

name: Ubuntu-22.04 package

on: [release]
on:
release:
types: [created]

jobs:
build:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ubuntu-24.04-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

name: Ubuntu-24.04 package

on: [release]
on:
release:
types: [created]

jobs:
build:
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

name: Windows 11

on: [release]
on: [push]

# on:
# release:
# types: [created]

defaults:
run:
Expand All @@ -23,12 +27,13 @@ jobs:
install: >-
curl
git
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-gtkmm3
mingw-w64-ucrt-x86_64-boost
mingw-w64-ucrt-x86_64-sqlite3
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-github-cli
pacman -S mingw-w64-ucrt-x86_64-gcc
pacman -S mingw-w64-ucrt-x86_64-gtkmm3
pacman -S mingw-w64-ucrt-x86_64-boost
pacman -S mingw-w64-ucrt-x86_64-sqlite3
pacman -S mingw-w64-ucrt-x86_64-cmake
pacman -S mingw-w64-ucrt-x86_64-python-matplotlib
pacman -S mingw-w64-ucrt-x86_64-python-sympy
- name: Authenticate GitHub CLI
run: gh auth setup-git
Expand All @@ -55,7 +60,7 @@ jobs:
- name: Upload release assets
run: |
ls ${{ github.workspace }}/artifacts/
gh release upload "${{ env.VERSION }}" ${{ github.workspace }}/artifacts/Cadabra_${{ env.VERSION }}_${{ matrix.arch }}.AppImage --clobber
gh release upload "${{ env.VERSION }}" cadabra2-${{ env.VERSION }}-win64.exe --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ else()
endif()
endif()
if(IS_ABSOLUTE ${PYTHON_SITE_PATH})
# CPack on windows complains if `install` commands contain absolute paths,
# so we do our best to make PYTHON_SITE_PATH relative to CMAKE_INSTALL_PREFIX.
# Of course, the net effect will be the same, as `install` with a relative
# DESTINATION will prepend CMAKE_INSTALL_PREFIX.
message(STATUS "Making PYTHON_SITE_PATH relative if possible")
string(REPLACE "${CMAKE_INSTALL_PREFIX}/" "" PYTHON_SITE_PATH_REL "${PYTHON_SITE_PATH}")
set(PYTHON_SITE_PATH ${PYTHON_SITE_PATH_REL})
Expand Down Expand Up @@ -572,7 +576,7 @@ if(APPIMAGE_MODE)
COMMAND cp -a ${Python_SITELIB}/setuptools AppDir/${PYTHON_SITELIB}/
COMMAND cp -a ${Python_STDARCH}/* AppDir/${Python_STDARCH}/
COMMAND ${LINUXDEPLOY} --appdir AppDir --plugin gtk --desktop-file AppDir/usr/share/applications/science.cadabra.cadabra2-gtk.desktop --output appimage
COMMAND mv Cadabra_2-${CMAKE_SYSTEM_PROCESSOR}.AppImage Cadabra_${CADABRA_VERSION_MAJOR}.${CADABRA_VERSION_MINOR}.${CADABRA_VERSION_PATCH}_${CMAKE_SYSTEM_PROCESSOR}.AppImage
COMMAND mv Cadabra_2-${CMAKE_SYSTEM_PROCESSOR}.AppImage Cadabra_${CADABRA_VERSION_SEM}_${CMAKE_SYSTEM_PROCESSOR}.AppImage
)
endif()

Expand All @@ -581,7 +585,7 @@ if(WIN32)
COMMAND cpack
# COMMAND osslsigncode sign -pkcs12 "/mnt/c/path/to/certificate.p12" -pass "certificate password" -n "Cadabra2" -i "https://cadabra.science" -t "http://timestamp.comodoca.com/authenticode" -in "cadabra2-${CADABRA_VERSION_MAJOR}.${CADABRA_VERSION_MINOR}.${CADABRA_VERSION_PATCH}-win64.exe" -out "cadabra2-${CADABRA_VERSION_MAJOR}.${CADABRA_VERSION_MINOR}.${CADABRA_VERSION_PATCH}-win64-installer.exe"
COMMAND gh auth setup-git
COMMAND release upload "${{ env.VERSION }}" cadabra2-${{ env.VERSION }}-win64.exe --clobber
COMMAND release upload "${CADABRA_VERSION_SEM}" cadabra2-${CADABRA_VERSION_SEM}-win64.exe --clobber
)
endif()

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Cadabra
.. image:: https://github.com/kpeeters/cadabra2/workflows/Docker/badge.svg
:target: https://github.com/kpeeters/cadabra2/actions?query=workflow%3ADocker

.. image:: https://anaconda.org/conda-forge/cadabra2-jupyter-kernel/badges/version.svg
:target: https://anaconda.org/conda-forge/cadabra2-jupyter-kernel
.. image:: https://github.com/kpeeters/cadabra2/workflows/Windows%2011/badge.svg
:target: https://github.com/kpeeters/cadabra2/actions?query=workflow%3AWindows%2011

*A field-theory motivated approach to computer algebra.*

Expand Down
1 change: 1 addition & 0 deletions cmake/version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ set(CADABRA_VERSION_MAJOR 2)
set(CADABRA_VERSION_MINOR 5)
set(CADABRA_VERSION_PATCH 5)
set(CADABRA_VERSION_TWEAK 0)
set(CADABRA_VERSION_SEM ${CADABRA_VERSION_MAJOR}.${CADABRA_VERSION_MINOR}.${CADABRA_VERSION_PATCH})
set(COPYRIGHT_YEARS "2001-2024")
math(EXPR SYSTEM_BITS "${CMAKE_SIZEOF_VOID_P} * 8")
find_program(GIT git PATHS ${GIT_DIR})
Expand Down
2 changes: 2 additions & 0 deletions frontend/gtkmm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ if (NOT INSTALL_TARGETS_ONLY)
]])

# Logic to get a start menu icon.
# https://crascit.com/2015/08/07/cmake_cpack_nsis_shortcuts_with_parameters/
# Does not work.
set(CPACK_NSIS_CREATE_ICONS_EXTRA
"CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${CMAKE_PROJECT_NAME}.lnk' '$INSTDIR\\\\cadabra2-gtk.exe'")
set(CPACK_NSIS_DELETE_ICONS_EXTRA
Expand Down

0 comments on commit 1193e1a

Please sign in to comment.