Skip to content

Commit

Permalink
Setup CI.
Browse files Browse the repository at this point in the history
This originally took a lot of time and commits, and it's still not
perfect. 13 commits compared to the 28 previously in the repository is
too many for me, so I'm squashing them.

Tags now automatically trigger a release, uploading the cpack zip file.
Commits get artifacts uploaded, the resulting zip is not quite the same
as the release zip (it's missing a folder) but it's Close Enough For
Now.
  • Loading branch information
kitlith committed Mar 11, 2022
1 parent c0284a9 commit 578a509
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
63 changes: 63 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build Feeder App
on: [push, workflow_dispatch]

jobs:
job:
name: ${{ matrix.os }}-${{ github.workflow }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]

steps:
- uses: actions/checkout@v2
with:
submodules: true

- uses: lukka/get-cmake@latest

- name: vcpkg setup/restore artifacts
uses: lukka/[email protected]
id: runvcpkg
with:
vcpkgJsonGlob: 'vcpkg.json'

- name: Prints output of run-vcpkg's action.
run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}' "

- name: Setup vcpkg env
run: vcpkg env
shell: cmd
if: matrix.os == 'windows-latest'

- name: CMake+vcpkg configure
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
shell: cmd

- name: Build
run: cmake --build build --config RelWithDebInfo
shell: cmd

# - name: List $RUNNER_WORKSPACE after build
# run: find $RUNNER_WORKSPACE
# shell: bash

- name: Package
run: cmake --build build --target package --config RelWithDebInfo
shell: cmd

- name: Get package path for Artifact
run: echo "artifactPath=$(realpath build/_CPack_Packages/*/ZIP/SlimeVR-Feeder-App-*/ --relative-to .)" >> $GITHUB_ENV
shell: bash

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
path: ${{ env.artifactPath }}

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: build/SlimeVR-Feeder-App-*.zip
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ install(FILES "${PROJECT_SOURCE_DIR}/manifest.vrmanifest"
)

if (WIN32)
install(FILES "${CMAKE_BINARY_DIR}/openvr_api.dll" "${CMAKE_BINARY_DIR}/fmt.dll" "${CMAKE_BINARY_DIR}/libprotobuf.dll" DESTINATION ".")
set(VCPKG_BINARIES "${CMAKE_BINARY_DIR}/vcpkg_installed/x64-windows/bin")
install(FILES "${VCPKG_BINARIES}/openvr_api.dll" "${VCPKG_BINARIES}/fmt.dll" "${VCPKG_BINARIES}/libprotobuf.dll" DESTINATION ".")
endif()

install(TARGETS "${PROJECT_NAME}"
Expand Down

0 comments on commit 578a509

Please sign in to comment.