|
| 1 | +name: Build Windows Packages |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + msys2-mingw64: |
| 12 | + name: MSYS2 MinGW64 |
| 13 | + runs-on: windows-latest |
| 14 | + |
| 15 | + defaults: |
| 16 | + run: |
| 17 | + shell: msys2 {0} |
| 18 | + |
| 19 | + steps: |
| 20 | + - name: Checkout repository |
| 21 | + uses: actions/checkout@v4 |
| 22 | + with: |
| 23 | + submodules: recursive |
| 24 | + |
| 25 | + - name: Setup Python 3.13 |
| 26 | + uses: actions/setup-python@v5 |
| 27 | + with: |
| 28 | + python-version: '3.13' |
| 29 | + architecture: 'x64' |
| 30 | + |
| 31 | + - name: Setup MSYS2 MINGW64 |
| 32 | + uses: msys2/setup-msys2@v2 |
| 33 | + with: |
| 34 | + msystem: MINGW64 |
| 35 | + update: true |
| 36 | + install: >- |
| 37 | + mingw-w64-x86_64-toolchain |
| 38 | + mingw-w64-x86_64-cmake |
| 39 | + mingw-w64-x86_64-openssl |
| 40 | + mingw-w64-x86_64-zeromq |
| 41 | + mingw-w64-x86_64-libsodium |
| 42 | + mingw-w64-x86_64-hidapi |
| 43 | + mingw-w64-x86_64-unbound |
| 44 | + mingw-w64-x86_64-protobuf |
| 45 | + mingw-w64-x86_64-libusb |
| 46 | + mingw-w64-x86_64-ntldd |
| 47 | + git |
| 48 | + make |
| 49 | + gettext |
| 50 | + base-devel |
| 51 | + wget |
| 52 | +
|
| 53 | + - name: Install ICU v75.1.1 |
| 54 | + shell: msys2 {0} |
| 55 | + run: | |
| 56 | + wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-icu-75.1-1-any.pkg.tar.zst |
| 57 | + pacman -U --noconfirm mingw-w64-x86_64-icu-75.1-1-any.pkg.tar.zst |
| 58 | +
|
| 59 | + - name: Install boost v1.85.0 |
| 60 | + shell: msys2 {0} |
| 61 | + run: | |
| 62 | + wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-boost-1.85.0-4-any.pkg.tar.zst |
| 63 | + pacman -U --noconfirm mingw-w64-x86_64-boost-1.85.0-4-any.pkg.tar.zst |
| 64 | +
|
| 65 | + - name: Install pybind11 v2.11.1 |
| 66 | + shell: msys2 {0} |
| 67 | + run: | |
| 68 | + wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-pybind11-2.11.1-1-any.pkg.tar.zst |
| 69 | + pacman -U --noconfirm mingw-w64-x86_64-pybind11-2.11.1-1-any.pkg.tar.zst |
| 70 | +
|
| 71 | + - name: Build monero |
| 72 | + shell: msys2 {0} |
| 73 | + run: | |
| 74 | + cd external/monero-cpp/external/monero-project |
| 75 | + mkdir -p build/release |
| 76 | + cd build/release |
| 77 | + cmake -G "MSYS Makefiles" \ |
| 78 | + -D STATIC=ON \ |
| 79 | + -D ARCH="x86-64" \ |
| 80 | + -D BUILD_64=ON \ |
| 81 | + -D CMAKE_BUILD_TYPE=Release \ |
| 82 | + -D BUILD_TAG="win-x64" \ |
| 83 | + -D CMAKE_TOOLCHAIN_FILE="../../cmake/64-bit-toolchain.cmake" \ |
| 84 | + -D MSYS2_FOLDER=$(cd $MINGW_PREFIX/.. && pwd -W) \ |
| 85 | + ../../ |
| 86 | + make wallet cryptonote_protocol |
| 87 | +
|
| 88 | + - name: Build monero-cpp |
| 89 | + shell: msys2 {0} |
| 90 | + run: | |
| 91 | + cd external/monero-cpp |
| 92 | + mkdir -p build |
| 93 | + cd build |
| 94 | + cmake .. |
| 95 | + cmake --build . |
| 96 | +
|
| 97 | + - name: Build monero-python |
| 98 | + shell: msys2 {0} |
| 99 | + run: | |
| 100 | + mkdir -p build |
| 101 | + cd build |
| 102 | + export WIN_PYTHON_EXE=$(cygpath -u "$PYTHON") |
| 103 | + cmake .. -DPython3_EXECUTABLE="$WIN_PYTHON_EXE" \ |
| 104 | + -DPython3_FIND_STRATEGY=LOCATION \ |
| 105 | + -DPython3_FIND_REGISTRY=NEVER |
| 106 | + cmake --build . |
| 107 | + mkdir -p ../dist |
| 108 | + cp *.pyd ../dist/monero.pyd |
| 109 | + ntldd -R *.pyd | grep mingw64 | awk '{print $3}' | while read -r line; do |
| 110 | + cp "$(cygpath -u "$line")" ../dist/ |
| 111 | + done |
| 112 | +
|
| 113 | + - name: Upload artifacts |
| 114 | + uses: actions/upload-artifact@v4 |
| 115 | + with: |
| 116 | + name: monero-python-win-amd64 |
| 117 | + path: dist/ |
| 118 | + |
| 119 | + msys2-mingw32: |
| 120 | + name: MSYS2 MinGW32 |
| 121 | + runs-on: windows-latest |
| 122 | + |
| 123 | + defaults: |
| 124 | + run: |
| 125 | + shell: msys2 {0} |
| 126 | + |
| 127 | + steps: |
| 128 | + - name: Checkout repository |
| 129 | + uses: actions/checkout@v4 |
| 130 | + with: |
| 131 | + submodules: recursive |
| 132 | + |
| 133 | + - name: Setup Python 3.13 |
| 134 | + uses: actions/setup-python@v5 |
| 135 | + with: |
| 136 | + python-version: '3.13' |
| 137 | + architecture: 'x86' |
| 138 | + |
| 139 | + - name: Setup MSYS2 MINGW32 |
| 140 | + uses: msys2/setup-msys2@v2 |
| 141 | + with: |
| 142 | + msystem: MINGW32 |
| 143 | + update: true |
| 144 | + install: >- |
| 145 | + mingw-w64-i686-toolchain |
| 146 | + mingw-w64-i686-cmake |
| 147 | + mingw-w64-i686-openssl |
| 148 | + mingw-w64-i686-zeromq |
| 149 | + mingw-w64-i686-libsodium |
| 150 | + mingw-w64-i686-hidapi |
| 151 | + mingw-w64-i686-unbound |
| 152 | + mingw-w64-i686-protobuf |
| 153 | + mingw-w64-i686-libusb |
| 154 | + mingw-w64-i686-icu |
| 155 | + mingw-w64-i686-ntldd |
| 156 | + git |
| 157 | + make |
| 158 | + gettext |
| 159 | + base-devel |
| 160 | + wget |
| 161 | +
|
| 162 | + - name: Install boost v1.85.0 |
| 163 | + shell: msys2 {0} |
| 164 | + run: | |
| 165 | + wget https://repo.msys2.org/mingw/mingw32/mingw-w64-i686-boost-1.85.0-4-any.pkg.tar.zst |
| 166 | + pacman -U --noconfirm mingw-w64-i686-boost-1.85.0-4-any.pkg.tar.zst |
| 167 | +
|
| 168 | + - name: Install pybind11 v2.11.1 |
| 169 | + shell: msys2 {0} |
| 170 | + run: | |
| 171 | + wget https://repo.msys2.org/mingw/mingw32/mingw-w64-i686-pybind11-2.11.1-1-any.pkg.tar.zst |
| 172 | + pacman -U --noconfirm mingw-w64-i686-pybind11-2.11.1-1-any.pkg.tar.zst |
| 173 | +
|
| 174 | + - name: Build monero |
| 175 | + shell: msys2 {0} |
| 176 | + run: | |
| 177 | + cd external/monero-cpp/external/monero-project |
| 178 | + mkdir -p build/release |
| 179 | + cd build/release |
| 180 | + cmake -G "MSYS Makefiles" \ |
| 181 | + -D STATIC=ON \ |
| 182 | + -D ARCH="i686" \ |
| 183 | + -D BUILD_64=OFF \ |
| 184 | + -D CMAKE_BUILD_TYPE=Release \ |
| 185 | + -D BUILD_TAG="win-x32" \ |
| 186 | + -D CMAKE_TOOLCHAIN_FILE="../../cmake/32-bit-toolchain.cmake" \ |
| 187 | + -D MSYS2_FOLDER=$(cd $MINGW_PREFIX/.. && pwd -W) \ |
| 188 | + ../../ |
| 189 | + make wallet cryptonote_protocol |
| 190 | +
|
| 191 | + - name: Build monero-cpp |
| 192 | + shell: msys2 {0} |
| 193 | + run: | |
| 194 | + cd external/monero-cpp |
| 195 | + mkdir -p build |
| 196 | + cd build |
| 197 | + cmake .. |
| 198 | + cmake --build . |
| 199 | +
|
| 200 | + - name: Build monero-python |
| 201 | + shell: msys2 {0} |
| 202 | + run: | |
| 203 | + mkdir -p build |
| 204 | + cd build |
| 205 | + export WIN_PYTHON_EXE=$(cygpath -u "$PYTHON") |
| 206 | + cmake .. -DPython3_EXECUTABLE="$WIN_PYTHON_EXE" \ |
| 207 | + -DPython3_FIND_STRATEGY=LOCATION \ |
| 208 | + -DPython3_FIND_REGISTRY=NEVER |
| 209 | + cmake --build . |
| 210 | + mkdir -p ../dist |
| 211 | + cp *.pyd ../dist/monero.pyd |
| 212 | + ntldd -R *.pyd | grep mingw64 | awk '{print $3}' | while read -r line; do |
| 213 | + cp "$(cygpath -u "$line")" ../dist/ |
| 214 | + done |
| 215 | +
|
| 216 | + - name: Upload artifacts |
| 217 | + uses: actions/upload-artifact@v4 |
| 218 | + with: |
| 219 | + name: monero-python-win-i686 |
| 220 | + path: dist/ |
0 commit comments