Merge branch 'master' of github.com:WohlSoft/Moondust-Project #646
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
name: Windows CI | |
on: | |
push: | |
branches: | |
- master | |
- stable | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
name: "${{ matrix.config.name }} | ${{ matrix.config.build_type }}" | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { | |
name: "64-bit", | |
os: windows-latest, | |
PLATFORM: x64, | |
WINXX_ARCH: win64, | |
extra_path: "/c/Qt/5.15.10-x64/bin:/c/MinGW-w64/mingw64/bin", | |
extra_options: "-DCMAKE_PREFIX_PATH=\"C:/Qt/5.15.10-x64/\" -DCMAKE_TOOLCHAIN_FILE=`pwd`/_common/ci_windows_mingw_toolchain_x64.cmake", | |
build_type: "Release", | |
upload_directory: "www/win32/moondust-win64/", | |
mingw_download: "https://wohlsoft.ru/docs/Software/MinGW/x86_64-13.1.0-release-posix-seh-msvcrt-rt_v11-rev1.7z", mingw_install_dir: "C:/MinGW-w64/", | |
qt_download: "https://wohlsoft.ru/docs/Software/QtBuilds/Qt-5.15.10-x64-mingw-w64-13.1.0-shared-release.7z", qt_install_dir: "C:/Qt/", | |
qt_dir: "C:/Qt/5.15.10-x64/bin", | |
ninja_download: "https://wohlsoft.ru/docs/Software/Ninja-Build/ninja-win.zip", ninja_install_dir: "C:/MinGW-w64/mingw64/bin", | |
lftp_download: "https://wohlsoft.ru/docs/Software/lftp-4.4.15.win64-openssl-1.0.1g.7z", lftp_install_dir: "C:/MinGW-w64/mingw64/" | |
} | |
- { | |
name: "32-bit", | |
os: windows-latest, | |
PLATFORM: Win32, | |
WINXX_ARCH: win32, | |
extra_path: "/c/Qt/5.6.3-i686/bin:/c/MinGW-w64/mingw32/bin", | |
extra_options: "-DCMAKE_PREFIX_PATH=\"C:/Qt/5.6.3-i686/\" -DCMAKE_TOOLCHAIN_FILE=`pwd`/_common/ci_windows_mingw_toolchain_x32.cmake", | |
build_type: "Release", | |
upload_directory: "www/win32/moondust-win32/", | |
mingw_download: "https://wohlsoft.ru/docs/Software/MinGW/i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z", mingw_install_dir: "C:/MinGW-w64/", | |
qt_download: "https://wohlsoft.ru/docs/Software/QtBuilds/Qt-5.6.3-i686-mingw-w64-8.1.0-shared-release.7z", qt_install_dir: "C:/Qt/", | |
qt_dir: "C:/Qt/5.6.3-i686/bin", | |
ninja_download: "https://wohlsoft.ru/docs/Software/Ninja-Build/ninja-win.zip", ninja_install_dir: "C:/MinGW-w64/mingw32/bin", | |
lftp_download: "https://wohlsoft.ru/docs/Software/lftp-4.4.15.win64-openssl-1.0.1g.7z", lftp_install_dir: "C:/MinGW-w64/mingw32/" | |
} | |
steps: | |
- name: Check for the upload support | |
id: upload-check | |
shell: bash | |
run: | | |
if [[ "${{ secrets.builds_login }}" != '' && \ | |
"${{ secrets.builds_password }}" != '' && \ | |
"${{ secrets.builds_host }}" != '' ]]; then | |
echo "available=true" >> $GITHUB_OUTPUT; | |
else | |
echo "available=false" >> $GITHUB_OUTPUT; | |
fi | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 3 | |
submodules: recursive | |
- uses: Wohlstand/branch-name@v1.0.1-wohl | |
- name: Check if a pull request | |
id: event-check | |
shell: bash | |
run: | | |
if [[ "${BRANCH_NAME}" == *"merge"* ]]; then | |
echo "--- This build is a pull-request ---" | |
echo "is_pull_request=true" >> $GITHUB_OUTPUT; | |
else | |
echo "--- This build is a normal branch build ---" | |
echo "is_pull_request=false" >> $GITHUB_OUTPUT; | |
fi | |
- name: Download MinGW | |
if: matrix.config.mingw_download | |
uses: carlosperate/download-file-action@v2 | |
with: | |
file-url: "${{ matrix.config.mingw_download }}" | |
file-name: mingw.7z | |
- name: Extract MinGW | |
if: matrix.config.mingw_install_dir | |
shell: bash | |
run: | | |
7z x mingw.7z -o"${{ matrix.config.mingw_install_dir }}" | |
- name: Download Qt | |
if: matrix.config.qt_download | |
uses: carlosperate/download-file-action@v2 | |
with: | |
file-url: "${{ matrix.config.qt_download }}" | |
file-name: qt.7z | |
- name: Extract Qt | |
if: matrix.config.qt_install_dir | |
shell: bash | |
run: | | |
7z x qt.7z -o"${{ matrix.config.qt_install_dir }}" | |
- name: Download Ninja | |
if: matrix.config.ninja_download | |
uses: carlosperate/download-file-action@v2 | |
with: | |
file-url: "${{ matrix.config.ninja_download }}" | |
file-name: ninja.zip | |
- name: Extract Ninja | |
if: matrix.config.ninja_install_dir | |
shell: bash | |
run: | | |
7z x ninja.zip -o"${{ matrix.config.ninja_install_dir }}" | |
- name: Download LFTP | |
if: matrix.config.lftp_download | |
uses: carlosperate/download-file-action@v2 | |
with: | |
file-url: "${{ matrix.config.lftp_download }}" | |
file-name: lftp.7z | |
- name: Extract LFTP | |
if: matrix.config.lftp_install_dir | |
shell: bash | |
run: | | |
7z x lftp.7z bin etc -o"${{ matrix.config.lftp_install_dir }}" | |
- name: Configure | |
shell: bash | |
run: | | |
if [[ ! -z "${{ matrix.config.extra_path }}" ]]; then | |
export PATH=${{ matrix.config.extra_path }}:${PATH} | |
export QT_DIR="${{ matrix.config.qt_dir }}" | |
export QtDir="${{ matrix.config.qt_dir }}" | |
echo "PATH environment: ${PATH}" | |
fi | |
echo "=====================================" | |
qmake --version | |
echo "=====================================" | |
gcc --version | |
echo "=====================================" | |
git --version | |
echo "=====================================" | |
cmake --version | |
echo "=====================================" | |
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_INSTALL_PREFIX="`pwd`/bin-cmake-release" -DPGE_INSTALL_DIRECTORY="PGE_Project" ${{ matrix.config.extra_options }} . | |
- name: Build | |
shell: bash | |
run: | | |
if [[ ! -z "${{ matrix.config.extra_path }}" ]]; then | |
export PATH=${{ matrix.config.extra_path }}:${PATH} | |
export QT_DIR="${{ matrix.config.qt_dir }}" | |
export QtDir="${{ matrix.config.qt_dir }}" | |
fi | |
export MAKEFLAGS=--keep-going | |
cmake --build build --target all --config ${{ matrix.config.build_type }} --parallel 3 | |
- name: Install | |
shell: bash | |
run: | | |
if [[ ! -z "${{ matrix.config.extra_path }}" ]]; then | |
export PATH=${{ matrix.config.extra_path }}:${PATH} | |
export QT_DIR="${{ matrix.config.qt_dir }}" | |
export QtDir="${{ matrix.config.qt_dir }}" | |
fi | |
export MAKEFLAGS=--keep-going | |
cmake --build build --target install --config ${{ matrix.config.build_type }} | |
- name: Deploy | |
shell: bash | |
run: | | |
if [[ ! -z "${{ matrix.config.extra_path }}" ]]; then | |
export PATH=${{ matrix.config.extra_path }}:${PATH} | |
export QT_DIR="${{ matrix.config.qt_dir }}" | |
export QtDir="${{ matrix.config.qt_dir }}" | |
fi | |
export MAKEFLAGS=--keep-going | |
cmake --build build --target windeploy --config ${{ matrix.config.build_type }} | |
cmake --build build --target enable_portable | |
cmake --build build --target put_online_help | |
cmake --build build --target create_zip | |
cmake --build build --target create_zip_tools | |
cmake --build build --target create_zip_install | |
mkdir _packed | |
mv bin-cmake-release/_packed/*.zip _packed | |
- name: Deploy to builds.wohlsoft.ru | |
if: success() && github.event_name != 'pull_request' && steps.event-check.outputs.is_pull_request == 'false' && steps.upload-check.outputs.available == 'true' | |
shell: bash | |
run: | | |
if [[ ! -z "${{ matrix.config.extra_path }}" ]]; then | |
export PATH=${{ matrix.config.extra_path }}:${PATH} | |
fi | |
UPLOAD_LIST="set ssl:verify-certificate no;" | |
for q in ./_packed/*.zip; do | |
UPLOAD_LIST="${UPLOAD_LIST} put -O ${{ matrix.config.upload_directory }} $q;" | |
done | |
lftp -e "${UPLOAD_LIST} exit" -u ${{ secrets.builds_login }},${{ secrets.builds_password }} ${{ secrets.builds_host }} | |
- name: List Build Directory | |
if: always() | |
shell: bash | |
run: | | |
git status | |
ls -lR build |