Skip to content

Commit

Permalink
Merge pull request #15 from Napalys/nk/versioning
Browse files Browse the repository at this point in the history
Nk/versioning
  • Loading branch information
Napalys authored Jun 16, 2024
2 parents 0bb1c80 + 7e0460e commit ed0d88f
Show file tree
Hide file tree
Showing 39 changed files with 1,437 additions and 357 deletions.
78 changes: 0 additions & 78 deletions .github/workflows/build.yaml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/build_linux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build on Linux

on: push

jobs:
build:
runs-on: ubuntu-latest
container:
image: napalys/attachable-clicker-docker:latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Cmake and build
run: |
mkdir build
cd build
cmake ..
cmake --build . --config Release
16 changes: 16 additions & 0 deletions .github/workflows/build_win.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Build windows

on: push

jobs:
build:
runs-on: [self-hosted, Windows, X64]

steps:
- uses: actions/checkout@v3

- name: Cmake and build
run: |
cmake -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE=D:/vcpkg/scripts/buildsystems/vcpkg.cmake -B build
cmake --build build --config Release
shell: cmd
96 changes: 16 additions & 80 deletions .github/workflows/deploy_windows.yaml
Original file line number Diff line number Diff line change
@@ -1,102 +1,38 @@
name: Compile and Release Qt5 Windows
name: Deploy windows

on:
push:
tags:
- '*'
pull_request:
branches:
- main


env:
QT_VERSION: "5.15.2"
MINGW_VERSION: "win64_mingw81"
MINGW_PATH: "mingw81_64"
BUILD_TYPE: Release

jobs:
build:
runs-on: windows-latest
defaults:
run:
shell: pwsh
runs-on: [self-hosted, Windows, X64]

steps:
- uses: actions/checkout@v2

- name: Cache Qt and MinGW
uses: actions/cache@v2
with:
path: |
${{github.workspace}}/Qt
C:/tools/mingw64
key: ${{ runner.os }}-qt-${{ env.QT_VERSION }}-mingw-${{ env.MINGW_VERSION }}
restore-keys: |
${{ runner.os }}-qt-${{ env.QT_VERSION }}-mingw-${{ env.MINGW_VERSION }}
- name: Install correct version of mingw
if: steps.cache-qt-mingw.outputs.cache-hit != 'true'
uses: crazy-max/ghaction-chocolatey@v1
with:
args: install mingw --version=8.1.0 -y

- name: Install Qt
if: steps.cache-qt-mingw.outputs.cache-hit != 'true'
uses: jurplel/install-qt-action@v2
with:
host: windows
target: "desktop"
version: ${{ env.QT_VERSION }}
arch: ${{ env.MINGW_VERSION }}
dir: "${{github.workspace}}/Qt"
install-deps: "true"

- name: Set Qt path and refresh
run: |
$path = "${{github.workspace}}/Qt/${{ env.QT_VERSION }}/${{ env.MINGW_PATH }}/bin"
echo "$path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
Update-SessionEnvironment
- name: Configure CMake Project
working-directory: ${{github.workspace}}
run: |
$Qt5_DIR="${{github.workspace}}/Qt/${{ env.QT_VERSION }}/${{ env.MINGW_PATH }}/lib/cmake/Qt5"
cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DQt5_DIR=$Qt5_DIR -G "MinGW Makefiles" -B ${{github.workspace}}/build
- name: Build project
working-directory: ${{github.workspace}}/build
run: |
mingw32-make.exe
- uses: actions/checkout@v3

- name: Prepare portable program
- name: Cmake and build
run: |
mkdir ${{github.workspace}}/build/artifacts
windeployqt.exe ${{github.workspace}}/build/injectionClicker.exe --no-translations --dir ${{github.workspace}}/build/artifacts
Copy-Item ${{github.workspace}}/build/injectionClicker.exe ${{github.workspace}}/build/artifacts/
cmake -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE=D:/vcpkg/scripts/buildsystems/vcpkg.cmake -B build
cmake --build build --config Release
shell: cmd

- name: Upload build artifact
uses: actions/upload-artifact@v2
with:
name: injectionClicker-${{ github.run_number }}
path: ${{github.workspace}}/build/artifacts/
name: InjectionClicker-${{ github.run_number }}
path: build/Release/

- name: Zip the application
run: |
Compress-Archive -Path ${{ github.workspace }}/build/artifacts/* -DestinationPath ${{ github.workspace }}/injectionClicker-${{ github.run_number }}.zip
- name: List files in the workspace
run: |
Get-ChildItem -Path ${{ github.workspace }} -Force | Select-Object Mode, LastWriteTime, Length, Name | Format-Table -AutoSize
- name: Create Release
Compress-Archive -Path build/Release/* -DestinationPath InjectionClicker-${{ github.run_number }}.zip
shell: powershell

- name: Create and Upload Release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ github.ref_name }}
body: Release of version ${{ github.ref_name }}
files: ./injectionClicker-${{ github.run_number }}.zip
files: ./InjectionClicker-${{ github.run_number }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 34 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
cmake_minimum_required(VERSION 3.10)
project(injectionClicker)
project(injectionClicker VERSION 1.0.0
DESCRIPTION ""
HOMEPAGE_URL "https://github.com/Napalys/Attachable-clicker"
LANGUAGES CXX C)

set(CMAKE_CXX_STANDARD 17)
if (NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(GIT_SHA "Unknown" CACHE STRING "SHA this build was generated from")

string(SUBSTRING "${GIT_SHA}"
0
8
GIT_SHORT_SHA)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

find_package(Qt5 COMPONENTS Widgets REQUIRED)

add_subdirectory(clicker)
add_subdirectory(discord)
add_subdirectory(configured_files)
add_subdirectory(imaging)

add_executable(${PROJECT_NAME} main.cpp
gui/mainwindow.cpp
Expand All @@ -20,12 +35,24 @@ add_executable(${PROJECT_NAME} main.cpp
gui/delegates/action_delegate.hpp
gui/dialogs/clicker_data_dialog.cpp
gui/dialogs/clicker_data_dialog.h
gui/managers/table_manager.cpp
gui/managers/table_manager.h
gui/dialogs/loading_dialog.cpp
gui/dialogs/loading_dialog.h
gui/managers/anomaly_manager.cpp
gui/managers/anomaly_manager.h
gui/dialogs/add_anomaly_dialog.cpp
gui/dialogs/add_anomaly_dialog.h
gui/managers/anomaly_runner.cpp
gui/managers/anomaly_runner.h
)

target_include_directories(${PROJECT_NAME} PRIVATE gui)
target_link_libraries(${PROJECT_NAME} PRIVATE
Qt5::Widgets
clicker_lib
Notifier
Imaging
)

set_target_properties(${PROJECT_NAME} PROPERTIES
Expand All @@ -43,3 +70,8 @@ target_compile_options(${PROJECT_NAME} PRIVATE
$<$<CXX_COMPILER_ID:GNU>:-Wall -Wextra -Wpedantic -Werror>
$<$<CXX_COMPILER_ID:MSVC>:/W4 /WX>
)

target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_BINARY_DIR}/configured_files/include/internal_use_only
gui
)
Loading

0 comments on commit ed0d88f

Please sign in to comment.