Skip to content

Commit 281356c

Browse files
committed
Publish builds on release
1 parent d52b04a commit 281356c

File tree

4 files changed

+62
-13
lines changed

4 files changed

+62
-13
lines changed

.github/workflows/ci.yml

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

src/CMakeLists.txt

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ elseif(APPLE)
135135
${MACDEPLOYQT_EXECUTABLE}
136136
$<TARGET_BUNDLE_DIR:${PROJECT_TARGET_NAME}>
137137
)
138-
if(DEFINED APPLE_ID)
139-
set(DEPLOY_COMMAND ${DEPLOY_COMMAND} -codesign=${APPLE_ID})
138+
if(DEFINED CODESIGN_ID)
139+
set(DEPLOY_COMMAND ${DEPLOY_COMMAND} -codesign=${CODESIGN_ID})
140140
endif()
141141
else()
142142
get_filename_component(_qt_dir "${_qt_bin_dir}" DIRECTORY)
@@ -212,12 +212,14 @@ if(APPLE)
212212
)
213213

214214
# Explicit sign with Hardened Runtime -------------------------------------
215+
if(DEFINED CODESIGN_ID)
215216
add_custom_target(codesign ALL
216-
COMMAND /usr/bin/codesign -vvv --deep --strict --force --options runtime --timestamp --sign ${CODESIGN_ID} "${APP_DIR_NEW}"
217-
DEPENDS gen-dsstore
218-
COMMENT "Codesign with Hardened Runtime"
219-
VERBATIM
220-
)
217+
COMMAND /usr/bin/codesign -vvv --deep --strict --force --options runtime --timestamp --sign ${CODESIGN_ID} "${APP_DIR_NEW}"
218+
DEPENDS gen-dsstore
219+
COMMENT "Codesign with Hardened Runtime"
220+
VERBATIM
221+
)
222+
endif()
221223
endif()
222224

223225
# Install ---------------------------------------------------------------------
@@ -259,8 +261,21 @@ set(CPACK_PACKAGE_RELEASE "1")
259261
set(CPACK_PACKAGE_CONTACT "${PROJECT_EMAIL}")
260262
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
261263
set(CPACK_PACKAGE_HOMEPAGE_URL "${PROJECT_WWW}")
262-
set(CPACK_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}")
263-
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
264+
set(_qt_kernel "${CMAKE_SYSTEM_NAME}")
265+
string(TOLOWER "${_qt_kernel}" _qt_kernel)
266+
if(_qt_kernel STREQUAL "windows")
267+
set(_qt_kernel "winnt")
268+
endif()
269+
set(CPACK_SYSTEM_NAME "${_qt_kernel}")
270+
set(_qt_processor "${CMAKE_SYSTEM_PROCESSOR}")
271+
string(TOLOWER "${_qt_processor}" _qt_processor)
272+
if(_qt_processor STREQUAL "AMD64")
273+
set(_qt_processor "x86_64")
274+
endif()
275+
if(_qt_processor STREQUAL "aarch64")
276+
set(_qt_processor "arm64")
277+
endif()
278+
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}-${_qt_processor}")
264279

265280
if(APPLE)
266281
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/LICENSE.rtf")

src/fea/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,9 @@ elseif (APPLE)
386386
target_sources(fea PRIVATE "${APP_ICON}")
387387

388388
add_custom_command(TARGET fea POST_BUILD
389-
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"
390-
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"
391-
COMMENT "Set CFBundleDisplayName"
389+
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"
390+
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"
391+
COMMENT "Set CFBundleName and CFBundleDisplayName"
392392
)
393393
endif()
394394

src/range-cloud-lib

0 commit comments

Comments
 (0)