Skip to content

Commit

Permalink
add github actions for build win/deb packages
Browse files Browse the repository at this point in the history
  • Loading branch information
fft committed May 25, 2022
1 parent 67b47ea commit c615f96
Show file tree
Hide file tree
Showing 6 changed files with 174 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ubuntu_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: ubuntu_release

on:
push:
branches: [ experimental ]
pull_request:
branches: [ experimental ]

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Qt
uses: jurplel/[email protected]
with:
version: 6.2.0

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DUSE_QT6=ON

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --verbose

- name: Package
run: cpack -G DEB
working-directory: ${{github.workspace}}/build

- uses: actions/upload-artifact@v3
with:
name: mytetra_${{github.sha}}.deb
path: ${{github.workspace}}/build/mytetra*.deb
39 changes: 39 additions & 0 deletions .github/workflows/ubuntu_release_qt5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: ubuntu_release_qt5

on:
push:
branches: [ experimental ]
pull_request:
branches: [ experimental ]

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Qt
uses: jurplel/[email protected]
with:
version: 5.15.2

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DUSE_QT6=OFF

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --verbose

- name: Package
run: cpack -G DEB
working-directory: ${{github.workspace}}/build

- uses: actions/upload-artifact@v3
with:
name: mytetra_qt5_${{github.sha}}.deb
path: ${{github.workspace}}/build/mytetra*.deb
42 changes: 42 additions & 0 deletions .github/workflows/windows_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: windows_release

on:
push:
branches: [ experimental ]
pull_request:
branches: [ experimental ]

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Qt
uses: jurplel/[email protected]
with:
version: 6.2.0

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DUSE_SYSTEM_MIMETEX=OFF -DUSE_QT6=ON

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --verbose

- name: Install
run: cmake --install ${{github.workspace}}/build

- name: Package
run: windeployqt --verbose 2 --no-compiler-runtime ${{github.workspace}}/build/mytetra_distr/mytetra.exe
working-directory: ${{github.workspace}}/build

- uses: actions/upload-artifact@v3
with:
name: mytetra_${{github.sha}}
path: ${{github.workspace}}/build/mytetra_distr/
42 changes: 42 additions & 0 deletions .github/workflows/windows_release_qt5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: windows_release_qt5

on:
push:
branches: [ experimental ]
pull_request:
branches: [ experimental ]

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Qt
uses: jurplel/[email protected]
with:
version: 5.15.2

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DUSE_SYSTEM_MIMETEX=OFF -DUSE_QT6=OFF

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --verbose

- name: Install
run: cmake --install ${{github.workspace}}/build

- name: Package
run: windeployqt --verbose 2 --no-compiler-runtime ${{github.workspace}}/build/mytetra_distr/mytetra.exe
working-directory: ${{github.workspace}}/build

- uses: actions/upload-artifact@v3
with:
name: mytetra_qt5_${{github.sha}}
path: ${{github.workspace}}/build/mytetra_distr/
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} /permissive-") #`/permissive-` somewhy required for Qt5 build

set(WIN_INSTALL_DIR "${CMAKE_BINARY_DIR}/mytetra_distr/")

# add necessary MSVC libraries to windows package. windeployqt will add necessary Qt-related libraries.
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION "${WIN_INSTALL_DIR}")
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
include(InstallRequiredSystemLibraries)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(GCC_WARNS "-Wall -Wextra -Werror")
set(CMAKE_C_FLAGS_DEBUG "${GCC_WARNS} -O0 -ggdb3")
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ MyTetra - smart manager for information collecting
MyTetra is open source and cross platform personal manager for information accumulation.
It is powerful program for data memorization and structuring notes.

Build status
======================
![ubuntu build](https://github.com/fftmp-forked/mytetra_dev/actions/workflows/ubuntu_release.yml/badge.svg?branch=experimental)
![ubuntu Qt5 build](https://github.com/fftmp-forked/mytetra_dev/actions/workflows/ubuntu_release_qt5.yml/badge.svg?branch=experimental)

![windows build](https://github.com/fftmp-forked/mytetra_dev/actions/workflows/windows_release.yml/badge.svg?branch=experimental)
![windows Qt5 build](https://github.com/fftmp-forked/mytetra_dev/actions/workflows/windows_release_qt5.yml/badge.svg?branch=experimental)

Repository mytetra_dev
======================
Expand Down

0 comments on commit c615f96

Please sign in to comment.