From d8e2635c9e39cee85810a2c0d626d3c8550a98c1 Mon Sep 17 00:00:00 2001 From: adrido Date: Fri, 17 Apr 2020 15:36:50 +0200 Subject: [PATCH] Create main.yml (#5) * Create main.yml * Fix osx build * Add package contact --- .github/workflows/main.yml | 69 +++++++++++++++++++++++++++++ Minetestmapper/CMakeLists.txt | 1 + Minetestmapper/PlayerAttributes.cpp | 3 +- 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..cb484ea --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,69 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + Build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + branch: [x86, x64] + type: [portable, installer] + include: + - os: windows-latest + vcpkg_cmd: zlib libpng sqlite3 libgd[core,png] --triplet x64-windows + cpack_install_generator: -G WIX + - os: ubuntu-latest + vcpkg_cmd: zlib libpng sqlite3 libgd[core,png] --triplet x64-linux + cpack_install_generator: -G DEB + - os: macos-latest + vcpkg_cmd: zlib libpng sqlite3 libgd[core,png] --triplet x64-osx + exclude: + - branch: x86 +# TODO: make x86 work +# TODO: generate the triplet of branch and os + steps: + - name: 🐞 Remove chocolately + run: Remove-Item -Path $env:ChocolateyInstall\\bin\\cpack.exe -Force + shell: pwsh + if: "contains(matrix.os, 'windows')" + + - name: Checkout + uses: actions/checkout@v1 + + - name: Run vcpkg + run: vcpkg install ${{matrix.vcpkg_cmd}} + + - name: CMake + run: | + echo -DBUILD_PORTABLE=$PORTABLE + cmake -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" -DCMAKE_BUILD_TYPE=Release . -DBUILD_PORTABLE=$PORTABLE + shell: bash + env: + PORTABLE: ${{contains(matrix.type, 'portable')}} + + - name: Build + run: cmake --build . --config Release + + - name: Package Install + run: cpack ${{matrix.cpack_install_generator}} + if: "!contains(matrix.type, 'portable')" + + - name: Package Portable + run: cpack -G ZIP + if: "contains(matrix.type, 'portable')" + + - uses: actions/upload-artifact@v2-preview + with: + name: Package + path: ./_CPack_Packages diff --git a/Minetestmapper/CMakeLists.txt b/Minetestmapper/CMakeLists.txt index 2f6472f..ecb6dd3 100644 --- a/Minetestmapper/CMakeLists.txt +++ b/Minetestmapper/CMakeLists.txt @@ -123,6 +123,7 @@ set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) set(CPACK_PACKAGE_INSTALL_DIRECTORY ${PROJECT_NAME}) set(CPACK_PACKAGE_VENDOR "Adrido") +set(CPACK_PACKAGE_CONTACT "https://github.com/adrido/") set(CPACK_GENERATOR "ZIP") include(CPack) install(TARGETS Minetestmapper RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR}) diff --git a/Minetestmapper/PlayerAttributes.cpp b/Minetestmapper/PlayerAttributes.cpp index ace632d..182214f 100644 --- a/Minetestmapper/PlayerAttributes.cpp +++ b/Minetestmapper/PlayerAttributes.cpp @@ -15,6 +15,7 @@ namespace fs = std::filesystem; #include #include #include +#include #include "PlayerAttributes.h" using namespace std; @@ -28,7 +29,7 @@ PlayerAttributes::PlayerAttributes(const std::string &sourceDirectory) if (!extractPlayersSqlite(playersPath)) { #ifdef HAVE_FILESYSTEM for (const auto &dirEntry : fs::directory_iterator(playersPath)) { - cout << dirEntry << std::endl; + cout << dirEntry.path().string() << std::endl; //dirEntry.path().filename(); extractPlayer(dirEntry.path().string());