Skip to content

Commit

Permalink
Remove MinGW from CI releases, only check that it builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Nopey committed Nov 28, 2024
1 parent b28d994 commit 5dd9c6d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 58 deletions.
59 changes: 9 additions & 50 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,12 @@ jobs:
path: openomf_${{ env.OPENOMF_VERSION }}-${{ steps.slug.outputs.sha8 }}_macos14_arm.zip
if-no-files-found: error

# Build windows package, release artifact (mingw-w64)
# Build MinGW, just so we know it still compiles
# -----------------------------------------------------------------------------------------------
build_windows:
check_mingw:
needs: [unittest]

name: Build windows-amd64 (mingw-w64)
name: Check MinGW-w64 cross
runs-on: ubuntu-latest

steps:
Expand All @@ -300,67 +300,26 @@ jobs:
wget -q https://github.com/omf2097/openomf-win-build/archive/refs/heads/main.zip
unzip -q main.zip && rm main.zip
- name: Generate Windows Release
- name: Build MinGW-w64
run: |
mkdir build-release && cd build-release
export WINEPATH="${GITHUB_WORKSPACE}/openomf-win-build-main/bin/"
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=release \
-DCMAKE_TOOLCHAIN_FILE="${GITHUB_WORKSPACE}/cmake-scripts/mingw-w64-toolchain.cmake" \
--toolchain "cmake-scripts/mingw-w64-toolchain.cmake" \
-DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/openomf-win-build-main/" \
-DCMAKE_INCLUDE_PATH="${GITHUB_WORKSPACE}/openomf-win-build-main/include/" \
-DCMAKE_LIBRARY_PATH="${GITHUB_WORKSPACE}/openomf-win-build-main/lib/" \
-DCMAKE_FIND_ROOT_PATH="${GITHUB_WORKSPACE}/openomf-win-build-main/" \
-DOMF_COMMAND_WRAPPER="wine" \
-DBUILD_LANGUAGES=OFF \
-DUSE_NATPMP=ON \
-DUSE_MINIUPNPC=ON \
"${GITHUB_WORKSPACE}"
make -j $(getconf _NPROCESSORS_ONLN)
make -j $(getconf _NPROCESSORS_ONLN) install
cp ${GITHUB_WORKSPACE}/openomf-win-build-main/bin/*.dll release/openomf/
- name: Get short SHA
id: slug
run: echo "sha8=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_OUTPUT

- name: Restore omf2097-assets.zip
id: cache-assets
uses: actions/cache/restore@v4
with:
path: omf2097-assets.zip
key: omf2097-assets.zip

- name: Download omf 2097 assets
if: steps.cache-assets.outputs.cache-hit != 'true'
run: wget -q "${{ env.OPENOMF_ASSETS_URL }}"

- name: Cache omf2097-assets.zip
if: steps.cache-assets.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: omf2097-assets.zip
key: omf2097-assets.zip

- name: Extract omf 2097 assets
run: unzip -j omf2097-assets.zip -d build-release/release/openomf/resources

- name: Generate ZIP package
run: |
cd build-release/release
zip -r ${GITHUB_WORKSPACE}/openomf_${{ env.OPENOMF_VERSION }}-${{ steps.slug.outputs.sha8 }}_windows_amd64.zip openomf
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: openomf_${{ env.OPENOMF_VERSION }}-${{ steps.slug.outputs.sha8 }}_windows_amd64
path: openomf_${{ env.OPENOMF_VERSION }}-${{ steps.slug.outputs.sha8 }}_windows_amd64.zip
if-no-files-found: error
-S . -B build
cmake --build build -j $(getconf _NPROCESSORS_ONLN)
# Create a "latest" release
# -----------------------------------------------------------------------------------------------
make_release:
needs: [build_windows, build_macos-arm, build_ubuntu, build_msvc]
needs: [check_mingw, build_macos-arm, build_ubuntu, build_msvc]
if: github.ref == 'refs/heads/master'

name: Make "latest" release
Expand Down
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ OPTION(USE_SANITIZERS "Enable Asan and Ubsan" OFF)
OPTION(USE_FATAL_SANITIZERS "Make Asan and Ubsan errors fatal" OFF)
OPTION(USE_TIDY "Use clang-tidy for checks" OFF)
OPTION(USE_FORMAT "Use clang-format for checks" OFF)
OPTION(BUILD_LANGUAGES "Build Language Files" ON)

OPTION(USE_MINIUPNPC "Use miniupnpc for port forwarding" OFF)
OPTION(USE_NATPMP "Use natpmp for port forwarding" OFF)
Expand Down Expand Up @@ -292,9 +293,10 @@ add_dependencies(openomf copy_shaders)

# Build tools if requested
set(TOOL_TARGET_NAMES)
# always build languagetool, for BuildLanguages.cmake
add_executable(languagetool tools/languagetool/main.c)
list(APPEND TOOL_TARGET_NAMES languagetool)
if(BUILD_LANGUAGES OR USE_TOOLS)
add_executable(languagetool tools/languagetool/main.c)
list(APPEND TOOL_TARGET_NAMES languagetool)
endif()
if (USE_TOOLS)
add_executable(bktool tools/bktool/main.c
tools/shared/animation_misc.c
Expand Down
12 changes: 7 additions & 5 deletions cmake-scripts/BuildLanguages.cmake
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
if(NOT BUILD_LANGUAGES)
return()
endif()

# OMF 2097 Epic Challenge Arena
set(LANG_STRCOUNT 1013)
set(OMF_LANGS ENGLISH GERMAN)
# OpenOMF-specific
set(LANG2_STRCOUNT 1)
set(OPENOMF_LANGS DANISH)

set(OMF_COMMAND_WRAPPER "" CACHE STRING "Optional wrapper to run languagetool with")

if(WIN32)
set(LANGUAGE_INSTALL_PATH "openomf/resources/")
else()
Expand All @@ -24,7 +26,7 @@ foreach(LANG ${OMF_LANGS})
DEPENDS "${TXT2}"
BYPRODUCTS "${DAT2}"
COMMAND ${CMAKE_COMMAND} -E echo_append "${LANG}, "
COMMAND ${OMF_COMMAND_WRAPPER} "$<TARGET_FILE:languagetool>" -i "${TXT2}" -o "${DAT2}" --check-count ${LANG2_STRCOUNT}
COMMAND "$<TARGET_FILE:languagetool>" -i "${TXT2}" -o "${DAT2}" --check-count ${LANG2_STRCOUNT}
)
install(FILES "${DAT2}" DESTINATION "${LANGUAGE_INSTALL_PATH}")
endforeach()
Expand All @@ -38,8 +40,8 @@ foreach(LANG ${OPENOMF_LANGS})
DEPENDS "${TXT}" "${TXT2}"
BYPRODUCTS "${LNG}" "{LNG2}"
COMMAND ${CMAKE_COMMAND} -E echo_append "${LANG}, "
COMMAND ${OMF_COMMAND_WRAPPER} "$<TARGET_FILE:languagetool>" -i "${TXT}" -o "${LNG}" --check-count ${LANG_STRCOUNT}
COMMAND ${OMF_COMMAND_WRAPPER} "$<TARGET_FILE:languagetool>" -i "${TXT2}" -o "${LNG2}" --check-count ${LANG2_STRCOUNT}
COMMAND "$<TARGET_FILE:languagetool>" -i "${TXT}" -o "${LNG}" --check-count ${LANG_STRCOUNT}
COMMAND "$<TARGET_FILE:languagetool>" -i "${TXT2}" -o "${LNG2}" --check-count ${LANG2_STRCOUNT}
)
install(FILES "${LNG}" "${LNG2}" DESTINATION "${LANGUAGE_INSTALL_PATH}")
endforeach()
Expand Down

0 comments on commit 5dd9c6d

Please sign in to comment.