Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download resources when they do not exist in source folder #136

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: CI
on: [push, pull_request]
env:
BUILD_NUMBER: ${{ github.run_number }}
CMAKE_BUILD_PARALLEL_LEVEL: 3
CMAKE_BUILD_PARALLEL_LEVEL: 4
jobs:
macos:
name: Build on macOS
runs-on: macos-latest
env:
MACOSX_DEPLOYMENT_TARGET: 11.0
MACOSX_DEPLOYMENT_TARGET: 12.0
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
steps:
- name: Checkout
Expand All @@ -24,18 +24,18 @@ jobs:
ubuntu:
name: Build on Ubuntu to ${{ matrix.container }}
runs-on: ubuntu-latest
container: ${{ matrix.container }}
container: ubuntu:${{ matrix.container }}
strategy:
matrix:
container: ['ubuntu:20.04', 'ubuntu:22.04']
container: ['20.04', '22.04', '24.04']
env:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Install dependencies
if: matrix.container == 'ubuntu:20.04'
if: matrix.container == '20.04'
run: apt update -qq && apt install --no-install-recommends -y git ca-certificates build-essential pkg-config cmake libpcsclite-dev libssl-dev qttools5-dev-tools qttools5-dev
- name: Install dependencies
if: matrix.container != 'ubuntu:20.04'
if: matrix.container != '20.04'
run: apt update -qq && apt install --no-install-recommends -y git ca-certificates build-essential pkg-config cmake libpcsclite-dev libssl-dev libgl-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -57,12 +57,12 @@ jobs:
uses: lukka/run-vcpkg@v7
with:
vcpkgArguments: openssl
vcpkgGitCommitId: 1f619be01b436b796dab797dd1e1721c5676f8ac
vcpkgGitCommitId: 18b028fe785e707265fa0e35590b7537ae1d12ea
vcpkgTriplet: x64-windows
- name: Install Qt
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@v4
with:
version: 6.6.1
version: 6.7.1
arch: win64_msvc2019_64
- name: Build
run: |
Expand Down
22 changes: 14 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,19 @@ if( CONFIG_URL )
if( LAST_CHECK_DAYS )
set_source_files_properties(Configuration.cpp PROPERTIES COMPILE_DEFINITIONS LAST_CHECK_DAYS=${LAST_CHECK_DAYS})
endif()
file( DOWNLOAD ${CONFIG_URL} ${CMAKE_CURRENT_BINARY_DIR}/config.json )
string( REPLACE ".json" ".rsa" RSA_URL ${CONFIG_URL} )
file( DOWNLOAD ${RSA_URL} ${CMAKE_CURRENT_BINARY_DIR}/config.rsa )
string( REPLACE ".json" ".pub" PUB_URL ${CONFIG_URL} )
file( DOWNLOAD ${PUB_URL} ${CMAKE_CURRENT_BINARY_DIR}/config.pub )
configure_file( config.qrc config.qrc COPYONLY )
qt_add_resources(CONFIG_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/config.qrc)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/config.json AND
EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/config.rsa AND
EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/config.pub)
qt_add_resources(CONFIG_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/config.qrc)
else()
file(DOWNLOAD ${CONFIG_URL} ${CMAKE_CURRENT_BINARY_DIR}/config.json)
string(REPLACE ".json" ".rsa" RSA_URL ${CONFIG_URL} )
file(DOWNLOAD ${RSA_URL} ${CMAKE_CURRENT_BINARY_DIR}/config.rsa)
string(REPLACE ".json" ".pub" PUB_URL ${CONFIG_URL} )
file(DOWNLOAD ${PUB_URL} ${CMAKE_CURRENT_BINARY_DIR}/config.pub)
configure_file(config.qrc config.qrc COPYONLY)
qt_add_resources(CONFIG_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/config.qrc)
endif()
target_compile_definitions(qdigidoccommon PUBLIC CONFIG_URL="${CONFIG_URL}")
target_sources(qdigidoccommon PRIVATE ${CONFIG_SOURCES} Configuration.cpp )
target_sources(qdigidoccommon PRIVATE ${CONFIG_SOURCES} Configuration.cpp)
endif()
Loading