Skip to content

Commit

Permalink
Merge branch 'feature/actions' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
kebekus committed Nov 18, 2023
2 parents ba298bb + a0932ef commit 7151ea8
Show file tree
Hide file tree
Showing 10 changed files with 160 additions and 113 deletions.
36 changes: 23 additions & 13 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,56 @@
name: Compile on Android

on:
create:
branches: [ master, working ]
push:
branches: [ master, working ]
pull_request:
branches: [ master, working ]
branches: [ develop ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Install Qt for Desktop
uses: jurplel/install-qt-action@v3
with:
version: '6.5.*'
cache: 'true'
cache-key-prefix: 'install-qt-action-host'
version: '6.*.*'
- name: Set QT_HOST_PATH
run: |
echo QT_HOST_PATH=$Qt6_DIR >> $GITHUB_ENV
- name: Install Qt for Android
uses: jurplel/install-qt-action@v3
with:
cache: 'true'
cache-key-prefix: 'install-qt-action-android'
target: 'android'
version: '6.5.*'
version: '6.*.*'
arch: 'android_arm64_v8a'
- name: Install Additional Software
run: |
sudo apt install doxygen graphviz librsvg2-bin
echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "platforms;android-31" "platform-tools" "build-tools;31.0.0"
echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --uninstall "platforms;android-33-ext5" "platforms;android-33-ext4"
echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "ndk;23.1.7779620"
echo ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/23.1.7779620 >> $GITHUB_ENV
echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "platforms;android-33" "platform-tools" "build-tools;33.0.2"
echo ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/25.1.8937393 >> $GITHUB_ENV
- name: Remove Unwanted Software
run: |
echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --uninstall "platforms;android-33-ext4" "platforms;android-33-ext5" "platforms;android-34-ext8"
echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "ndk;25.1.8937393"
- name: Configure
run: |
mkdir -p build
cmake -E make_directory build
$Qt6_DIR/bin/qt-cmake -DCMAKE_BUILD_TYPE:STRING=Debug -S . -B build
- name: Compile
run: |
cmake --build build
cmake --build build --target apk
cp build/src/android-build/build/outputs/apk/debug/android-build-debug.apk addTimes-android-arm64v8a.apk
- name: Upload to developerBuilds
run: |
gh release upload --clobber developerBuilds addTimes-android-arm64v8a.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50 changes: 23 additions & 27 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,47 @@
name: Compile on iOS
name: Compile on iOS-Simulator

on:
create:
branches: [ ios ]
push:
branches: [ ios ]
pull_request:
branches: [ ios ]


env:
APPLICATION: "addhoursandminutes"
branches: [ develop ]

jobs:
build:

runs-on: macos-12

runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
submodules: true
- name: Install Qt for Desktop
uses: jurplel/install-qt-action@v3
with:
version: '6.5.*'
cache: 'true'
cache-key-prefix: 'install-qt-action-macOS-host'
version: '6.5.2'
- name: Set QT_HOST_PATH
run: |
echo QT_HOST_PATH=$Qt6_DIR >> $GITHUB_ENV
- name: Install Qt for iOS
uses: jurplel/install-qt-action@v3
with:
cache: 'true'
cache-key-prefix: 'install-qt-action-ios'
target: 'ios'
version: '6.5.*'
- name: Setup env
run: |
export PATH=$Qt6_DIR/bin:$PATH
ln -s /Users/runner/work/${{env.APPLICATION}}/Qt/6.5.0/macos /Users/runner/work/${{env.APPLICATION}}/Qt/6.5.0/clang_64
qmake --version
version: '6.5.2'
- name: Configure
env:
XADT: ${{ secrets.XCODE_ATTRIBUTE_DEVELOPMENT_TEAM }}
run: |
cmake -E make_directory build
cd build
$Qt6_DIR/bin/qt-cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=$XADT
$Qt6_DIR/bin/qt-cmake -S . -B build
- name: Compile
run: |
cd build
cmake --build . -- -allowProvisioningUpdates
cmake --build . -- -sdk iphonesimulator
- name: Package
run: |
brew install create-dmg
create-dmg addTimes-iphonesimulator.dmg build/src/Debug-iphonesimulator
- name: Upload to developerBuilds
run: |
gh release upload --clobber developerBuilds addTimes-iphonesimulator.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37 changes: 24 additions & 13 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,45 @@
name: Compile on Linux

on:
create:
branches: [ master ]
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches: [ develop ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.5.*'
cache: 'true'
version: '6.*.*'
- name: Install LinuxDeploy
uses: miurahr/install-linuxdeploy-action@v1
with:
plugins: appimage
- name: Install Additional Software
run: |
sudo apt update
sudo apt install doxygen graphviz
- name: Configure and Compile
sudo apt install appstream fuse libxcb-cursor0
- name: Configure
run: |
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
cmake -E make_directory build
cmake -DCMAKE_BUILD_TYPE=Debug -S . -B build
$Qt6_DIR/bin/qt-cmake -DCMAKE_INSTALL_PREFIX:STRING=$PWD/app/usr -DCMAKE_BUILD_TYPE:STRING=Debug -S . -B build
- name: Compile and Install
run: |
cmake --build build
cmake --build build --target install
- name: Package
run: |
linuxdeploy-x86_64.AppImage --appdir app --output appimage
mv Add_Times-x86_64.AppImage addTimes-Linux.AppImage
- name: Upload to developerBuilds
run: |
gh release upload --clobber developerBuilds addTimes-Linux.AppImage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 18 additions & 9 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,39 @@
name: Compile on MacOS

on:
create:
branches: [ master ]
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches: [ develop ]

jobs:
build:

runs-on: macos-12
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.5.*'
cache: 'true'
version: '6.5.2'
- name: Configure
run: |
cmake -E make_directory build
$Qt6_DIR/bin/qt-cmake -DCMAKE_BUILD_TYPE:STRING=Debug -S . -B build
$Qt6_DIR/bin/qt-cmake -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_INSTALL_PREFIX=. -S . -B build
- name: Compile
run: |
cmake --build build
- name: Package
run: |
cmake --build build --target install
$Qt6_DIR/bin/macdeployqt addhoursandminutes.app -dmg
mv addhoursandminutes.dmg addTimes-macOS-universal.dmg
- name: Upload to developerBuilds
run: |
gh release upload --clobber developerBuilds addTimes-macOS-universal.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

39 changes: 39 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Compile on Windows

on:
push:
branches: [ develop ]

jobs:
build:

runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
cache: 'true'
version: '6.*.*'
- name: Configure
run: |
cmake -E make_directory build
qt-cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_INSTALL_PREFIX:STRING=${{ github.workspace }}\addTimes -S . -B build
- name: Compile
run: |
cmake --build build
- name: Install
run: |
cmake --build build --target INSTALL
- name: Package
run: |
powershell Compress-Archive addTimes addTimes-windows64.zip
- name: Upload to developerBuilds
run: |
gh release upload --clobber developerBuilds addTimes-windows64.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42 changes: 1 addition & 41 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,6 @@ math(EXPR PROJECT_VERSION_CODE 100000*${PROJECT_VERSION_MAJOR}+1000*${PROJECT_VE
add_definitions( -DPROJECT_VERSION="${PROJECT_VERSION}" )


#
# Find GIT repository data.
#

if (EXISTS ${CMAKE_SOURCE_DIR}/.git)
# Get the current working branch
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message("Currently working with git branch ${GIT_BRANCH}")

# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message("Currently working with git Commit ${GIT_COMMIT}")

# Get the latest commit date of the working branch
execute_process(
COMMAND git log -1 --format=%as
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message("Currently working with git commit from ${GIT_DATE}")
else()
message("Not working from a GIT directory")
set(GIT_BRANCH "")
set(GIT_BRANCH "")
set(GIT_COMMIT "")
set(GIT_DATE "")
endif()


if(IOS)
set(PRODUCT_BUNDLE_IDENTIFIER de.akafliegfreiburg.addhoursandminutes)
# set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "XXXXX")
Expand All @@ -62,7 +22,7 @@ endif()


# Include required packages
find_package(Qt6 6.5 REQUIRED COMPONENTS Core LinguistTools Quick Svg)
find_package(Qt6 6.5 REQUIRED COMPONENTS Core LinguistTools Quick QuickControls2 Svg)
qt_standard_project_setup()
qt_policy(SET QTP0001 NEW)

Expand Down
8 changes: 5 additions & 3 deletions metadata/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# On Unix, generate and install metadata information
#
# On Linux, generate and install metadata information
#

if (UNIX)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
CONFIGURE_FILE(${APP_ID}.desktop ${APP_ID}.desktop)
INSTALL(FILES ${PROJECT_BINARY_DIR}/metadata/${APP_ID}.desktop
RENAME ${APP_ID}.desktop
Expand All @@ -14,4 +16,4 @@ if (UNIX)
INSTALL(FILES ${PROJECT_SOURCE_DIR}/metadata/${APP_ID}.svg
RENAME ${APP_ID}.svg
DESTINATION share/icons/hicolor/scalable/apps)
endif (UNIX)
endif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
10 changes: 7 additions & 3 deletions packaging/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ add_custom_target(tar
)


if (UNIX AND NOT ANDROID)
add_subdirectory(flatpak)
endif (UNIX AND NOT ANDROID)
#
# Prepare TAR Flatpak distribution
#

if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
add_subdirectory(flatpak)
endif ()
Loading

0 comments on commit 7151ea8

Please sign in to comment.