diff options
author | Nicolas Werner <nicolas.werner@gmx.net> | 2020-12-08 13:40:44 -0500 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@gmx.net> | 2020-12-08 13:40:44 -0500 |
commit | 622a9f709b9a17d6c872d9de5ce9245951ab8bd6 (patch) | |
tree | 1c1c9cc322557301521fc02636443f12acb7e0f8 /.ci | |
parent | 5aa221800667687a7b8178abb905a1dc87843b59 (diff) | |
parent | ab7a75a988a3d94d11c8484abfccd238af119d82 (diff) |
Merge branch 'gitlab-ci' into 'master'
Update .gitlab-ci.yml
See merge request nheko-reborn/nheko!1
Diffstat (limited to '.ci')
-rw-r--r-- | .ci/macos/Brewfile | 9 | ||||
-rwxr-xr-x | .ci/script.sh | 1 | ||||
-rwxr-xr-x | .ci/upload-nightly-gitlab.sh | 9 |
3 files changed, 19 insertions, 0 deletions
diff --git a/.ci/macos/Brewfile b/.ci/macos/Brewfile new file mode 100644 index 00000000..c32360ee --- /dev/null +++ b/.ci/macos/Brewfile @@ -0,0 +1,9 @@ +tap "nlohmann/json" + +brew "clang-format" +brew "cmake" +brew "ninja" +brew "openssl" +brew "qt5" +brew "python3" +brew "nlohmann_json"
\ No newline at end of file diff --git a/.ci/script.sh b/.ci/script.sh index f43a6efb..63e7f135 100755 --- a/.ci/script.sh +++ b/.ci/script.sh @@ -71,6 +71,7 @@ cmake -GNinja -H. -Bbuild \ -DHUNTER_ROOT=".hunter" \ -DHUNTER_ENABLED=ON -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHUNTER_CONFIGURATION_TYPES=RelWithDebInfo \ + -DUSE_BUNDLED_OPENSSL=OFF \ -DCI_BUILD=ON fi cmake --build build diff --git a/.ci/upload-nightly-gitlab.sh b/.ci/upload-nightly-gitlab.sh new file mode 100755 index 00000000..c08857c1 --- /dev/null +++ b/.ci/upload-nightly-gitlab.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +file="$1" +fileName="nheko-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}-${file##*-}" + +uri=$(curl -H "Authorization: Bearer ${MATRIX_ACCESS_TOKEN}" -H "Content-Type: application/x-compressed" -X POST --data-binary "@${file}" "https://matrix.neko.dev/_matrix/media/r0/upload?filename=${fileName}" --http1.1 | python -c "import sys, json; print(json.load(sys.stdin)['content_uri'])") +echo "Uploaded to ${uri}" + +curl -H "Authorization: Bearer ${MATRIX_ACCESS_TOKEN}" -H "Content-Type: application/json" -X PUT -d "{ \"body\": \"${fileName}\", \"filename\": \"${fileName}\", \"info\": { \"mimetype\": \"application/x-compressed\", \"size\": $(wc -c < ${file}) }, \"msgtype\": \"m.file\", \"url\": \"${uri}\" }" "https://matrix.neko.dev/_matrix/client/r0/rooms/${ROOM}/send/m.room.message/$(date +%s)" |