🎉 Added duf
This commit is contained in:
parent
76afab8189
commit
6e23d82c0a
22
.gitignore
vendored
22
.gitignore
vendored
@ -1,4 +1,24 @@
|
|||||||
build
|
build
|
||||||
tmp
|
tmp
|
||||||
.vscode/
|
.vscode/
|
||||||
.idea/
|
.idea/
|
||||||
|
|
||||||
|
### CMake ###
|
||||||
|
CMakeLists.txt.user
|
||||||
|
CMakeCache.txt
|
||||||
|
CMakeFiles
|
||||||
|
CMakeScripts
|
||||||
|
Testing
|
||||||
|
Makefile
|
||||||
|
cmake_install.cmake
|
||||||
|
install_manifest.txt
|
||||||
|
compile_commands.json
|
||||||
|
CTestTestfile.cmake
|
||||||
|
_deps
|
||||||
|
|
||||||
|
### CMake Patch ###
|
||||||
|
# External projects
|
||||||
|
*-prefix/
|
||||||
|
build.ninja
|
||||||
|
|
||||||
|
.ninja_log
|
||||||
|
28
CMakeLists.txt
Normal file
28
CMakeLists.txt
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
|
project(ci-scripts LANGUAGES NONE)
|
||||||
|
|
||||||
|
set(TOOLS
|
||||||
|
"kitware/cmake"
|
||||||
|
"mozilla/sccache"
|
||||||
|
"muesli/duf"
|
||||||
|
)
|
||||||
|
|
||||||
|
foreach (item IN ITEMS ${TOOLS})
|
||||||
|
string(REPLACE "/" ";" RLIST ${item})
|
||||||
|
list(GET RLIST 1 TOOL)
|
||||||
|
add_custom_target(
|
||||||
|
${TOOL}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -DGH_REPO=${item} -P ${CMAKE_SOURCE_DIR}/update.cmake
|
||||||
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
|
list(APPEND all_tools ${TOOL})
|
||||||
|
endforeach ()
|
||||||
|
|
||||||
|
add_custom_target(
|
||||||
|
update_all ALL
|
||||||
|
COMMENT "Update all tools"
|
||||||
|
DEPENDS ${all_tools}
|
||||||
|
VERBATIM
|
||||||
|
)
|
10
Makefile
10
Makefile
@ -1,10 +0,0 @@
|
|||||||
all : cmake sccache lazygit
|
|
||||||
|
|
||||||
cmake:
|
|
||||||
cmake -DTOOL=cmake -DREPO=kitware -P update.cmake
|
|
||||||
|
|
||||||
sccache:
|
|
||||||
cmake -DTOOL=sccache -DREPO=mozilla -P update.cmake
|
|
||||||
|
|
||||||
lazygit:
|
|
||||||
cmake -DTOOL=lazygit -DREPO=jesseduffield -P update.cmake
|
|
5
install-duf.sh
Normal file
5
install-duf.sh
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
wget "https://github.com/muesli/duf/releases/download/v0.6.2/duf_0.6.2_linux_amd64.deb" -nv -O /tmp/duf.deb
|
||||||
|
dpkg -i /tmp/duf.deb
|
5
templates/install-duf.sh.in
Normal file
5
templates/install-duf.sh.in
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
wget "https://github.com/muesli/duf/releases/download/v@VERSION@/duf_@VERSION@_linux_amd64.deb" -nv -O /tmp/duf.deb
|
||||||
|
dpkg -i /tmp/duf.deb
|
15
update.cmake
15
update.cmake
@ -1,6 +1,15 @@
|
|||||||
message("TOOL \"${TOOL}\" REPO \"${REPO}\"")
|
macro(mgs text)
|
||||||
|
execute_process(COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --green --bold ${text})
|
||||||
|
endmacro()
|
||||||
|
|
||||||
SET(URL "https://api.github.com/repos/${REPO}/${TOOL}/releases/latest")
|
|
||||||
|
string(REPLACE "/" ";" RLIST "${GH_REPO}")
|
||||||
|
list(GET RLIST 0 OWNER)
|
||||||
|
list(GET RLIST 1 TOOL)
|
||||||
|
|
||||||
|
mgs("TOOL \"${TOOL}\" OWNER \"${OWNER}\"")
|
||||||
|
|
||||||
|
SET(URL "https://api.github.com/repos/${OWNER}/${TOOL}/releases/latest")
|
||||||
|
|
||||||
execute_process(COMMAND curl -s -L ${URL} OUTPUT_VARIABLE VERSION_JSON)
|
execute_process(COMMAND curl -s -L ${URL} OUTPUT_VARIABLE VERSION_JSON)
|
||||||
string(JSON VERSION_DIRTY GET ${VERSION_JSON} tag_name)
|
string(JSON VERSION_DIRTY GET ${VERSION_JSON} tag_name)
|
||||||
@ -8,5 +17,5 @@ string(JSON VERSION_DIRTY GET ${VERSION_JSON} tag_name)
|
|||||||
string(REGEX REPLACE [^0-9\\.] "" VERSION "${VERSION_DIRTY}")
|
string(REGEX REPLACE [^0-9\\.] "" VERSION "${VERSION_DIRTY}")
|
||||||
string(REPLACE "." "_" VERSION_UNDERSCORE ${VERSION})
|
string(REPLACE "." "_" VERSION_UNDERSCORE ${VERSION})
|
||||||
|
|
||||||
message("Latest VERSION ${VERSION}")
|
mgs("Latest VERSION ${VERSION}")
|
||||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/templates/install-${TOOL}.sh.in" "${CMAKE_CURRENT_LIST_DIR}/install-${TOOL}.sh" @ONLY)
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/templates/install-${TOOL}.sh.in" "${CMAKE_CURRENT_LIST_DIR}/install-${TOOL}.sh" @ONLY)
|
Loading…
x
Reference in New Issue
Block a user