Generate chiaki.rb Cask on Travis (#37)

This commit is contained in:
Florian Märkl 2019-09-27 11:28:50 +02:00 committed by GitHub
commit 326ffdaa8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 0 deletions

1
.gitignore vendored
View file

@ -16,3 +16,4 @@ appdir
/openssl* /openssl*
.vs .vs
CMakeSettings.json CMakeSettings.json
chiaki.rb

View file

@ -89,6 +89,10 @@ matrix:
- /usr/local/opt/qt/bin/macdeployqt Chiaki.app -dmg - /usr/local/opt/qt/bin/macdeployqt Chiaki.app -dmg
- export DEPLOY_FILE="Chiaki-macOS-${CHIAKI_VERSION}-x86_64.dmg" - export DEPLOY_FILE="Chiaki-macOS-${CHIAKI_VERSION}-x86_64.dmg"
- mv Chiaki.dmg "$DEPLOY_FILE" - mv Chiaki.dmg "$DEPLOY_FILE"
- cmake -DCHIAKI_VERSION="${CHIAKI_VERSION}" -DCHIAKI_DMG="${DEPLOY_FILE}" -DCHIAKI_DMG_FILENAME="${DEPLOY_FILE}" -DCHIAKI_CASK_OUT=chiaki.rb -P scripts/configure-cask.cmake
- echo "------------------- chiaki.rb cask -------------------"
- cat chiaki.rb
- echo "------------------------------------------------------"
- name: Android - name: Android
language: android language: android

15
scripts/chiaki.rb.in Normal file
View file

@ -0,0 +1,15 @@
cask 'chiaki' do
version '@CHIAKI_VERSION@'
sha256 '@CHIAKI_DMG_SHA256@'
url "https://github.com/thestr4ng3r/chiaki/releases/download/v@CHIAKI_VERSION@/@CHIAKI_DMG_FILENAME@"
name 'Chiaki'
homepage 'https://github.com/thestr4ng3r/chiaki'
app "Chiaki.app"
zap trash: [
'~/Library/Application Support/Chiaki',
'~/Library/Preferences/com.chiaki.Chiaki.plist'
]
end

View file

@ -0,0 +1,11 @@
if(NOT CHIAKI_VERSION OR NOT CHIAKI_DMG OR NOT CHIAKI_DMG_FILENAME OR NOT CHIAKI_CASK_OUT)
message(FATAL_ERROR "CHIAKI_VERSION, CHIAKI_DMG, CHIAKI_DMG_FILENAME and CHIAKI_CASK_OUT must be set.")
endif()
if(CHIAKI_VERSION MATCHES "^v([0-9].*)$")
set(CHIAKI_VERSION "${CMAKE_MATCH_1}")
endif()
file(SHA256 "${CHIAKI_DMG}" CHIAKI_DMG_SHA256)
configure_file("${CMAKE_CURRENT_LIST_DIR}/chiaki.rb.in" "${CHIAKI_CASK_OUT}")