diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1784879 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,36 @@ +name: Build + +on: [push] + +jobs: + build: + runs-on: windows-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up cache + uses: actions/cache@v3 + with: + path: cache + key: build + restore-keys: build + + - name: Configure project + run: cmake -DCPM_SOURCE_CACHE=cache -S . -B build + + - name: Build project + run: cmake --build build --config Release + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: release-artifacts + path: build/Release/playlister3.dll + + - name: Create release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: build/Release/playlister3.dll \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 84fabef..7bef9dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,9 +7,15 @@ include(cmake/GetGitRevisionDescription.cmake) get_git_head_revision(GIT_REFSPEC GIT_COMMIT_HASH) +if (NOT GIT_REFSPEC) + set(GIT_REFSPEC "release") +endif() + string(REPLACE "refs/heads/" "" GIT_BRANCH_NAME ${GIT_REFSPEC}) string(SUBSTRING ${GIT_COMMIT_HASH} 0 8 GIT_COMMIT_HASH_SHORT) +set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + CPMAddPackage( NAME spdlog GIT_TAG v1.11.0