From cbff23fed4265cb0a28c9fabb56810bd85fc07c1 Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Thu, 23 Jun 2022 07:22:44 +0700 Subject: [PATCH] add MSYS2 build to CI (#622) * add MSYS2 build to CI * attempt to fix install * misunderstood msystem * try with base-devel * bring back gcc * set cmake generator * try ninja * add release.yml * upload all *.zip * fix syntax * working release.yml * add CHANGELOG.md * update main.yml, delete travis.sh * get version from tag * remove msys2 32-bit build from main.yml --- .github/workflows/main.yml | 62 ++++++++++++++++++++++++------- .github/workflows/release.yml | 70 +++++++++++++++++++++++++++++++++++ .travis.sh | 24 ------------ CHANGELOG.md | 9 +++++ 4 files changed, 127 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/release.yml delete mode 100755 .travis.sh create mode 100644 CHANGELOG.md diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5bb2f359..f63d8c98 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ on: branches: [ master ] jobs: - build: + linux: runs-on: ubuntu-latest strategy: @@ -20,10 +20,18 @@ jobs: - uses: actions/checkout@v2 - - name: Make + - name: Configure env: CC: ${{ matrix.compiler }} - run: $GITHUB_WORKSPACE/.travis.sh + run: cmake -B build -G "Ninja" + + - name: Build + run: cmake --build build + + - name: Install + run: | + cd build + ninja -v package cppcheck: runs-on: ubuntu-latest @@ -35,23 +43,49 @@ jobs: - uses: actions/checkout@v2 - name: Run cppcheck - env: - ANALYZE: true - run: $GITHUB_WORKSPACE/.travis.sh + shell: bash + run: | + cppcheck --error-exitcode=1 -j2 -DRANGECHECK -D_WIN32 -Isrc src toolsrc 2> stderr.txt + RET=$? + if [ -s stderr.txt ] + then + cat stderr.txt + fi + exit $RET - crossbuild: - runs-on: ubuntu-latest + msys2: + runs-on: windows-latest + + defaults: + run: + shell: msys2 {0} steps: - - name: Install dependencies - run: sudo apt-get update && sudo apt-get install gcc-mingw-w64-x86-64 ninja-build + - name: Setup MSYS2 + uses: msys2/setup-msys2@v2 + with: + msystem: mingw64 + install: >- + git + mingw-w64-x86_64-gcc + mingw-w64-x86_64-cmake + mingw-w64-x86_64-ninja + mingw-w64-x86_64-SDL2 + mingw-w64-x86_64-SDL2_mixer + mingw-w64-x86_64-SDL2_net - uses: actions/checkout@v2 - - name: Cross build - env: - CROSSRULE: "-DCMAKE_TOOLCHAIN_FILE=../CrossToWin64.cmake" - run: $GITHUB_WORKSPACE/.travis.sh + - name: Configure + run: cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release + + - name: Build + run: cmake --build build + + - name: Package + run: | + cd build + cpack -G ZIP - name: Upload artifacts uses: actions/upload-artifact@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..5fee6a84 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,70 @@ +name: release + +on: + push: + tags: + - '*' + +jobs: + create_release: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF##*_} + + - name: Create Release + id: create_release + uses: softprops/action-gh-release@v1 + with: + name: Woof! ${{ steps.get_version.outputs.VERSION }} + + build_release: + name: Build Release + runs-on: windows-latest + + defaults: + run: + shell: msys2 {0} + + strategy: + fail-fast: false + matrix: + include: + - { sys: mingw64, env: x86_64 } + - { sys: mingw32, env: i686 } + + steps: + - name: Setup MSYS2 + uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.sys }} + install: >- + git + mingw-w64-${{matrix.env}}-gcc + mingw-w64-${{matrix.env}}-cmake + mingw-w64-${{matrix.env}}-ninja + mingw-w64-${{matrix.env}}-SDL2 + mingw-w64-${{matrix.env}}-SDL2_mixer + mingw-w64-${{matrix.env}}-SDL2_net + + - uses: actions/checkout@v2 + + - name: Configure + run: cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release + + - name: Build + run: cmake --build build + + - name: Package + run: | + cd build + cpack -G ZIP + + - name: Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ needs.create_release.outputs.tag-name }} + body_path: CHANGELOG.md + files: build/*.zip diff --git a/.travis.sh b/.travis.sh deleted file mode 100755 index 12b78454..00000000 --- a/.travis.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -if [ "$ANALYZE" = "true" ] -then - cppcheck --error-exitcode=1 -j2 -DRANGECHECK -D_WIN32 -Isrc src toolsrc 2> stderr.txt - RET=$? - if [ -s stderr.txt ] - then - cat stderr.txt - fi - exit $RET -else - set -e - export VERBOSE=1 - rm -rf build/ CMakeCache.txt CMakeFiles/ - mkdir build && cd build - if [ -n "$RELEASE" ] - then - BUILD_TYPE="-DCMAKE_BUILD_TYPE=Release" - fi - cmake -G "Ninja" "$BUILD_TYPE" "$CROSSRULE" .. -DENABLE_WERROR=ON - ninja -v - DESTDIR=/tmp/whatever ninja -v install/strip - ninja -v package -fi diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..48d5c21f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +**New Features and Improvements** +* Two-colored HUD widgets (as in Crispy Doom). + +**Bug Fixes** +* Fix complevel vanilla scrollers. +* Fix reload level during intermission. +* Check if the lump can be a Doom patch in `R_GenerateLookup()`. +* Fix `gcc-12 -O3` compiler warnings. +* Only create autoload subdirectory relative to `D_DoomPrefDir()`.