Skip to content

Commit

Permalink
ci: upload install folder as action artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
adriweb committed Jan 23, 2023
1 parent 86511ba commit 6da204d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/build.linux.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,12 @@ jobs:
run: |
cd build
cmake --build . --target install
- name: Prepare install folder for upload
run: mv prefix tilibs_linux_static${{ matrix.statictype }}_${{ github.sha }}

- name: Upload install folder
uses: actions/upload-artifact@v3
with:
name: tilibs_linux_static${{ matrix.statictype }}_${{ github.sha }}
path: ${{ github.workspace }}/tilibs_linux_static${{ matrix.statictype }}_${{ github.sha }}/
9 changes: 9 additions & 0 deletions .github/workflows/build.mac.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,12 @@ jobs:
run: |
cd build
cmake --build . --target install
- name: Prepare install folder for upload
run: mv prefix tilibs_mac_static${{ matrix.statictype }}_${{ github.sha }}

- name: Upload install folder
uses: actions/upload-artifact@v3
with:
name: tilibs_mac_static${{ matrix.statictype }}_${{ github.sha }}
path: ${{ github.workspace }}/tilibs_mac_static${{ matrix.statictype }}_${{ github.sha }}/
19 changes: 18 additions & 1 deletion .github/workflows/build.windows.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,23 @@ jobs:
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
configurePreset: '${{ matrix.arch }}-${{ matrix.config }}'
buildPreset: '${{ matrix.arch }}-${{ matrix.config }}'
configurePresetAdditionalArgs: "['-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/prefix']"
env:
VCPKG_FORCE_SYSTEM_BINARIES: 1
CMAKE_INSTALL_PREFIX_OVERRIDE: '${{ github.workspace }}/prefix'

- name: Install tilibs
uses: lukka/run-cmake@d8897e1de33ed2ec4628ec5acf69861da7c719db # latest as of 2023-01-13
with:
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
buildPreset: '${{ matrix.arch }}-${{ matrix.config }}'
buildPresetAdditionalArgs: "['--target install']"

- name: Prepare install folder for upload
shell: cmd
run: rename prefix tilibs_windows_${{ github.sha }}

- name: Upload install folder
uses: actions/upload-artifact@v3
with:
name: tilibs_windows_${{ github.sha }}
path: tilibs_windows_${{ github.sha }}
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ project(tilibs C CXX)
# - WISH: provide Find* CMake modules for the libs themselves?
#

# In case there was an env-var override...
if(DEFINED ENV{CMAKE_INSTALL_PREFIX_OVERRIDE})
set(CMAKE_INSTALL_PREFIX "$ENV{CMAKE_INSTALL_PREFIX_OVERRIDE}")
endif()
# Be sure to have the expected install prefix format
if(CMAKE_INSTALL_PREFIX)
file(TO_CMAKE_PATH "${CMAKE_INSTALL_PREFIX}" CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "CMAKE_INSTALL_PREFIX" FORCE)
message("CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}")
endif()

# Our modules
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/.cmake)
file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/.cmake/*.cmake")
Expand Down

0 comments on commit 6da204d

Please sign in to comment.