Skip to content

Commit 854c5c3

Browse files
author
Kasper Peeters
committed
Add DESTDIR for ubuntu package builds. Make windows builds use the same action in push and release mode.
1 parent c11ced4 commit 854c5c3

File tree

3 files changed

+59
-16
lines changed

3 files changed

+59
-16
lines changed

.github/workflows/windows-installer.yml

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,60 @@ defaults:
1616

1717
jobs:
1818
msys2-ucrt64:
19-
runs-on: windows-latest
19+
strategy:
20+
matrix:
21+
include:
22+
- os: windows-2022
23+
name: x86_64
24+
display-name: "Windows 11 x86_64"
25+
msystem: ucrt64
26+
midfix: ucrt-x86_64
27+
- os: windows-11-arm
28+
name: arm64
29+
msystem: clangarm64
30+
midfix: clang-aarch64
31+
display-name: "Windows 11 arm64"
32+
runs-on: ${{ matrix.os }}
2033
name: Windows 11
2134
defaults:
2235
run:
2336
shell: msys2 {0}
2437

2538
steps:
39+
- name: Install WiX v4/v5 Tool
40+
run: |
41+
dotnet tool install --tool-path c:\WiX\bin wix --version 5.0.2
42+
c:\WiX\bin\wix extension add --global WixToolset.UI.wixext/5.0.2
43+
shell: pwsh
44+
45+
- name: Add WiX toolkit to PATH
46+
shell: bash
47+
run: |
48+
echo "WiX installed at ${WIX}, hopefully..."
49+
echo "Listing C:/WiX/bin"
50+
ls "C:/WiX/bin"
51+
echo "Listing Program Files (x86):"
52+
ls "C:/Program Files (x86)/"
53+
echo "Listing Program Files:"
54+
ls "C:/Program Files/"
55+
echo "${WIX}bin" >> $GITHUB_PATH
56+
2657
- uses: msys2/setup-msys2@v2
2758
with:
28-
msystem: UCRT64
59+
msystem: ${{ matrix.msystem }}
2960
update: true
3061
install: >-
3162
curl
3263
git
33-
mingw-w64-ucrt-x86_64-gcc
34-
mingw-w64-ucrt-x86_64-python
35-
mingw-w64-ucrt-x86_64-gtkmm3
36-
mingw-w64-ucrt-x86_64-boost
37-
mingw-w64-ucrt-x86_64-sqlite3
38-
mingw-w64-ucrt-x86_64-cmake
39-
mingw-w64-ucrt-x86_64-python-matplotlib
40-
mingw-w64-ucrt-x86_64-python-sympy
41-
mingw-w64-ucrt-x86_64-github-cli
64+
mingw-w64-${{ matrix.midfix }}-gcc
65+
mingw-w64-${{ matrix.midfix }}-python
66+
mingw-w64-${{ matrix.midfix }}-gtkmm3
67+
mingw-w64-${{ matrix.midfix }}-boost
68+
mingw-w64-${{ matrix.midfix }}-sqlite3
69+
mingw-w64-${{ matrix.midfix }}-cmake
70+
mingw-w64-${{ matrix.midfix }}-python-matplotlib
71+
mingw-w64-${{ matrix.midfix }}-python-sympy
72+
mingw-w64-${{ matrix.midfix }}-github-cli
4273
4374
- name: Authenticate GitHub CLI
4475
run: gh auth setup-git

.github/workflows/windows.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
# Test the build on Windows; does not create any assets.
1+
# Create Windows installer on a github push or release event
2+
# (upload to the release assets in the latter case).
23

34
name: Windows 11
45

5-
on: [push]
6+
on:
7+
push:
8+
release:
9+
types: [created]
610

711
defaults:
812
run:
@@ -121,13 +125,21 @@ jobs:
121125
VER=$(cat build/VERSION)
122126
echo "VERSION=$VER" >> $GITHUB_ENV
123127
124-
- name: Upload installer
128+
- name: Upload installer as build artifact
125129
uses: actions/upload-artifact@v4
126130
with:
127131
name: cadabra2-windows-${{ matrix.name }}.msi
128132
path: build/cadabra2-${{ env.VERSION }}-win64.msi
129133
retention-days: 2
130134

135+
- name: Upload release assets
136+
if: github.event_name == 'release'
137+
run: |
138+
mv build/cadabra2-${{ env.VERSION }}-win64.msi build/cadabra2-${{ env.VERSION }}-windows-${{ matrix.name }}.msi
139+
gh release upload "${{ env.GIT_TAG_VERSION }}" build/cadabra2-${{ env.VERSION }}-windows-${{ matrix.name }}.msi --clobber
140+
env:
141+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142+
131143
test:
132144
needs: msys2-ucrt64
133145
strategy:

core/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,12 +539,12 @@ if(NOT WIN32)
539539
set(CDB_BIN_PATH \"${CDB_BIN_PATH}\")
540540
541541
# Remove old binary if it exists
542-
file(REMOVE \"\${CMAKE_INSTALL_PREFIX}/\${CDB_BIN_PATH}/cadabra2\")
542+
file(REMOVE \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${CDB_BIN_PATH}/cadabra2\")
543543
544544
# Create symbolic link
545545
execute_process(
546546
COMMAND ${CMAKE_COMMAND} -E create_symlink cadabra2-cli cadabra2
547-
WORKING_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/\${CDB_BIN_PATH}\"
547+
WORKING_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${CDB_BIN_PATH}\"
548548
)
549549
")
550550
endif()

0 commit comments

Comments
 (0)