-
Notifications
You must be signed in to change notification settings - Fork 99
131 lines (121 loc) · 4.69 KB
/
compile_windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: compile_windows
on: [push]
env:
BUILD_TYPE: Release
WXVERSION: 3.2.6
permissions:
contents: read
jobs:
compile_windows:
name: Compile using minGW
permissions:
contents: write # for actions/create-release to create a release
runs-on: windows-latest
steps:
- name: create_release
if: startsWith(github.ref, 'refs/tags/Version')
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Automatic compilation on a new release
draft: false
prerelease: false
- name: Checkout wxMaxima
uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 15
path: wxMaxima
- name: Install Ninja
run: |
choco install ninja
- name: Cache wxWidgets
uses: actions/cache@v4
env:
cache-name: cache-wxWidgets
with:
path: wxWidgets-${{env.WXVERSION}}
key: ${{ runner.os }}-build-${{ env.cache-name }}-3
# multi-job compilation is broken in wxWidgets, see https://trac.wxwidgets.org/ticket/19029
# compiling wxWidgets via cmake works, but the result isn't detected by cmake any more.
- name: Compile wxWidgets
run: |
if (Test-Path wxWidgets-${{env.WXVERSION}}) { echo "wxWidgets already present"} else {
Invoke-WebRequest -Uri https://github.com/wxWidgets/wxWidgets/releases/download/v${{env.WXVERSION}}/wxWidgets-${{env.WXVERSION}}.zip -OutFile wxWidgets-${{env.WXVERSION}}.zip
Expand-Archive -LiteralPath wxWidgets-${{env.WXVERSION}}.zip -DestinationPath wxWidgets-${{env.WXVERSION}}
cd wxWidgets-${{env.WXVERSION}}
cd build
cd msw
mingw32-make -f makefile.gcc SHELL=cmd.exe SHARED=0 BUILD=release
cd ..
cd ..
cd ..
}
- name: Configure wxMaxima
run: |
cd wxMaxima
new-item build -itemtype directory
new-item build\Release -itemtype directory
cd build
cmake -DwxWidgets_ROOT_DIR="../../wxWidgets-${{env.WXVERSION}}" -DwxWidgets_LIB_DIR="../../wxWidgets-${{env.WXVERSION}}/lib/gcc_lib" -DwxWidgets_CONFIGURATION=mswu -DCMAKE_BUILD_TYPE=release -G "MinGW Makefiles" -DwxWidgets_USE_DEBUG=false -DwxWidgets_USE_UNICODE=true -DwxWidgets_USE_STATIC=true -G Ninja ..
cd ..
cd ..
- name: Compile wxMaxima
run: |
cd wxMaxima
cd build
cmake --build .
cd ..
cd ..
- name: Package wxMaxima
run: |
cd wxMaxima
cd build
cpack
cd ..
cd ..
MSVC:
permissions:
contents: read # for actions/checkout to fetch code
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: Compile using MSVC
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache wxWidgets
uses: actions/cache@v4
env:
cache-name: cache-wxWidgets
with:
path: wxwidgets-source
key: ${{ runner.os }}-build-msvc-${{ env.cache-name }}-${env:WXVERSION}-1
- name: wxWidgets
run: |
if (Test-Path wxwidgets-source) { echo "wxWidgets already present"} else {
echo "Downloading wxWidgets"
curl "https://github.com/wxWidgets/wxWidgets/releases/download/v${env:WXVERSION}/wxWidgets-${env:WXVERSION}.7z" -L --output wxWidgets.7z
echo "Unpacking wxWidgets sources"
7z x "wxWidgets.7z" "-owxwidgets-source" -y
echo "Building wxWidgets from sources"
cd "wxwidgets-source"
cmake "." -DwxUSE_WEBVIEW_EDGE=true
cmake --build .
cd .. }
- name: Configure wxMaxima
run: |
mkdir build
cd build
cmake -DwxWidgets_ROOT_DIR="../wxwidgets-source" -DwxWidgets_LIB_DIR="../wxwidgets-source/lib/vc_x64_dll" -DwxWidgets_CONFIGURATION="mswud" -DCMAKE_BUILD_TYPE=${{ env.config}} ..
cd ..
- name: Compile wxMaxima
run: |
cd build
cmake --build .
cd ..