Skip to content

Commit f73ca7b

Browse files
committed
Publish builds on release
1 parent 505a87b commit f73ca7b

File tree

4 files changed

+51
-10
lines changed

4 files changed

+51
-10
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,3 +240,37 @@ jobs:
240240
# Mark RC/Beta as prerelease automatically (optional)
241241
prerelease: ${{ contains(github.ref_name, '-rc') || contains(github.ref_name, '-beta') }}
242242
files: artifacts/*
243+
244+
- name: Prepare Range Cloud client key and certificate
245+
run: |
246+
set -euo pipefail
247+
mkdir -p $HOME/.private_keys
248+
echo "$RANGE_CLOUD_KEY_PEM" | base64 -d > $HOME/.private_keys/range_cloud_key.pem
249+
chmod 600 $HOME/.private_keys/range_cloud_key.pem
250+
echo "$RANGE_CLOUD_CERT_PEM" | base64 -d > $HOME/.private_keys/range_cloud_cert.pem
251+
chmod 600 $HOME/.private_keys/range_cloud_cert.pem
252+
env:
253+
RANGE_CLOUD_KEY_PEM: ${{ secrets.RANGE_CLOUD_KEY_PEM }}
254+
RANGE_CLOUD_CERT_PEM: ${{ secrets.RANGE_CLOUD_CERT_PEM }}
255+
256+
- name: Publish on Range Cloud
257+
run: |
258+
set -euo pipefail
259+
for f in artifacts/*; do
260+
[ -f "$f" ] || continue
261+
fileName="$(basename $f)"
262+
fileInfo=${fileName#$REPO_NAME}
263+
fileVersion=$(echo $fileInfo | cut -d'-' -f2)
264+
fileOs=$(echo $fileInfo | cut -d'-' -f3)
265+
fileArch=$(echo $fileInfo | cut -d'-' -f4 | cut -d'.' -f1)
266+
echo "Uploading: $fileName"
267+
curl -X PUT --upload-file $f -o $HOME/response.json --key $HOME/.private_keys/range_cloud_key.pem --key-type PEM --pass 12345678 --cert $HOME/.private_keys/range_cloud_cert.pem https://range-software.com:4012/file-upload/?resource-name=$fileName
268+
fileId=$(jq -r '.id' $HOME/response.json)
269+
echo "Updating file version: $fileName : $fileVersion"
270+
curl -X POST -d "$fileVersion" --key $HOME/.private_keys/range_cloud_key.pem --key-type PEM --pass 12345678 --cert $HOME/.private_keys/range_cloud_cert.pem https://range-software.com:4012/file-update-version/?resource-id=$fileId
271+
echo "Updating file tags: $fileName : $REPO_NAME,$fileOs,$fileArch"
272+
curl -X POST -d "$REPO_NAME,$fileOs,$fileArch" --key $HOME/.private_keys/range_cloud_key.pem --key-type PEM --pass 12345678 --cert $HOME/.private_keys/range_cloud_cert.pem https://range-software.com:4012/file-update-tags/?resource-id=$fileId
273+
done
274+
env:
275+
RANGE_CLOUD_KEY_PASSWORD: ${{ secrets.RANGE_CLOUD_KEY_PASSWORD }}
276+
REPO_NAME: ${{ github.event.repository.name }}

src/CMakeLists.txt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,14 @@ if(APPLE)
142142
)
143143

144144
# Explicit sign with Hardened Runtime -------------------------------------
145+
if(DEFINED CODESIGN_ID)
145146
add_custom_target(codesign ALL
146-
COMMAND /usr/bin/codesign -vvv --deep --strict --force --options runtime --timestamp --sign ${CODESIGN_ID} "${APP_DIR_NEW}"
147-
DEPENDS gen-dsstore
148-
COMMENT "Codesign with Hardened Runtime"
149-
VERBATIM
150-
)
147+
COMMAND /usr/bin/codesign -vvv --deep --strict --force --options runtime --timestamp --sign ${CODESIGN_ID} "${APP_DIR_NEW}"
148+
DEPENDS gen-dsstore
149+
COMMENT "Codesign with Hardened Runtime"
150+
VERBATIM
151+
)
152+
endif()
151153
endif()
152154

153155
# Install ---------------------------------------------------------------------
@@ -184,7 +186,12 @@ set(CPACK_PACKAGE_RELEASE "1")
184186
set(CPACK_PACKAGE_CONTACT "${PROJECT_EMAIL}")
185187
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
186188
set(CPACK_PACKAGE_HOMEPAGE_URL "${PROJECT_WWW}")
187-
set(CPACK_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}")
189+
set(_qt_kernel "${CMAKE_SYSTEM_NAME}")
190+
string(TOLOWER "${_qt_kernel}" _qt_kernel)
191+
if(_qt_kernel STREQUAL "windows")
192+
set(_qt_kernel "winnt")
193+
endif()
194+
set(CPACK_SYSTEM_NAME "${_qt_kernel}")
188195
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
189196

190197
if(APPLE)

src/cloud-client/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ elseif (APPLE)
7373
target_sources(cloud-client PRIVATE "${APP_ICON}")
7474

7575
add_custom_command(TARGET cloud-client POST_BUILD
76-
COMMAND /usr/libexec/PlistBuddy -c "Set :CFBundleName string '${PROJECT_SHORT_NAME}'" "$<TARGET_BUNDLE_DIR_NAME:${PROJECT_TARGET_NAME}>/Contents/Info.plist" || /usr/libexec/PlistBuddy -c "Add :CFBundleName string '${PROJECT_SHORT_NAME}'" "$<TARGET_BUNDLE_DIR_NAME:${PROJECT_TARGET_NAME}>/Contents/Info.plist"
77-
COMMAND /usr/libexec/PlistBuddy -c "Set :CFBundleDisplayName string '${PROJECT_SHORT_NAME}'" "$<TARGET_BUNDLE_DIR_NAME:${PROJECT_TARGET_NAME}>/Contents/Info.plist" || /usr/libexec/PlistBuddy -c "Add :CFBundleDisplayName string '${PROJECT_SHORT_NAME}'" "$<TARGET_BUNDLE_DIR_NAME:${PROJECT_TARGET_NAME}>/Contents/Info.plist"
78-
COMMENT "Set CFBundleDisplayName"
76+
COMMAND /usr/libexec/PlistBuddy -c "Set :CFBundleName '${PROJECT_SHORT_NAME}'" "$<TARGET_BUNDLE_DIR_NAME:${PROJECT_TARGET_NAME}>/Contents/Info.plist" || /usr/libexec/PlistBuddy -c "Add :CFBundleName string '${PROJECT_SHORT_NAME}'" "$<TARGET_BUNDLE_DIR_NAME:${PROJECT_TARGET_NAME}>/Contents/Info.plist"
77+
COMMAND /usr/libexec/PlistBuddy -c "Set :CFBundleDisplayName '${PROJECT_SHORT_NAME}'" "$<TARGET_BUNDLE_DIR_NAME:${PROJECT_TARGET_NAME}>/Contents/Info.plist" || /usr/libexec/PlistBuddy -c "Add :CFBundleDisplayName string '${PROJECT_SHORT_NAME}'" "$<TARGET_BUNDLE_DIR_NAME:${PROJECT_TARGET_NAME}>/Contents/Info.plist"
78+
COMMENT "Set CFBundleName and CFBundleDisplayName"
7979
)
8080
endif()
8181

src/range-cloud-lib

0 commit comments

Comments
 (0)