diff --git a/.github/workflows/cmake-single-platform.yml b/.github/workflows/cmake-single-platform.yml new file mode 100644 index 0000000..987801c --- /dev/null +++ b/.github/workflows/cmake-single-platform.yml @@ -0,0 +1,72 @@ +name: CMake on a single platform + +on: + push: + branches: [ "v5.4.1", "v5.3.5" ] + pull_request: + branches: [ "v5.4.1", "v5.3.5" ] + +jobs: + build: + runs-on: windows-latest + + env: + BUILD_TYPE: Release + c_compiler: cl + cpp_compiler: cl + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Set reusable strings + id: strings + shell: bash + run: | + BUILD_DIR_NAME=cmake-build-${{env.BUILD_TYPE}}-${{runner.arch}}; echo "build-output-dir=${{github.workspace}}/${BUILD_DIR_NAME,,}" >> "$GITHUB_OUTPUT" + + - name: Configure CMake + run: > + cmake -B "${{steps.strings.outputs.build-output-dir}}" --install-prefix "${{github.workspace}}/output" -Wdev --warn-uninitialized --log-context -L + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + -DCMAKE_CXX_COMPILER=${{env.cpp_compiler}} + -DCMAKE_C_COMPILER=${{env.c_compiler}} + -S "${{github.workspace}}" + + - name: Build + run: cmake --build ${{steps.strings.outputs.build-output-dir}} --config ${{env.BUILD_TYPE}} + + - name: Install + run: cmake --install ${{steps.strings.outputs.build-output-dir}} + + # - name: Test + # working-directory: ${{github.workspace}}/build + # # Execute tests defined by the CMake configuration. + # # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + # run: ctest -C ${{env.BUILD_TYPE}} + + - name: Copy Files + shell: powershell + run: | + Copy-Item -Path "src.lua/README.txt" -Destination "${{github.workspace}}/output" + + - uses: actions/upload-artifact@v4 + with: + name: build-output + path: ${{github.workspace}}/output + + release: + runs-on: windows-latest + needs: build + + steps: + - uses: actions/download-artifact@v4 + with: + name: build-output + path: ${{github.workspace}} + + - name: Zip + shell: powershell + run: Compress-Archive -Path bin,include,lib,README.txt -Destination artifact.zip +