Skip to content

Commit

Permalink
add a basic ci build for linux and macos
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlaltca committed Aug 9, 2023
1 parent 2b02174 commit cee30d0
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 1 deletion.
46 changes: 46 additions & 0 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build Linux

on:
push:
branches:
- master
paths-ignore:
- '**.md'
tags:
- '*'
pull_request:
paths-ignore:
- '**.md'

jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: build-linux-release

- name: Install Qt
uses: jurplel/install-qt-action@v3

- name: Install other prerequisites
run: |
sudo apt update
sudo apt install -y enchant-2 libenchant-2-dev libperl-dev
- name: Configure CMake
run: |
cd '${{github.workspace}}'
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
- name: Build
run: |
cd '${{github.workspace}}'
cd build
cmake --build .
73 changes: 73 additions & 0 deletions .github/workflows/build_macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Build macOS

on:
push:
branches:
- master
paths-ignore:
- '**.md'
tags:
- '*'
pull_request:
paths-ignore:
- '**.md'

jobs:
build-macos:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: build-macos-release

- name: Install Qt
uses: jurplel/install-qt-action@v3

- name: Install other prerequisites
run: |
brew update
brew install enchant openssl --force-bottle
- name: Configure CMake
run: |
cd '${{github.workspace}}'
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
- name: Build
run: |
cd '${{github.workspace}}'
cd build
cmake --build .
- name: Install
run: |
cd '${{github.workspace}}'
cd build
cmake --install .
- name: Detect version
shell: bash
run: |
cd '${{github.workspace}}'
kvi_version=$(grep -i "^set(VERSION_RELEASE .*)$" CMakeLists.txt | egrep -o '[0-9\.]' | tr -d '\n')
git_desc=$(git describe --always)
echo "dmg_name=KVIrc-$kvi_version-dev-$git_desc" >> "$GITHUB_ENV"
- name: Create DMG
uses: QQxiaoming/create-dmg-action@v0.0.2
with:
name: '${{ env.dmg_name }}'
srcdir: 'build/KVIrc.app'


- name: Publish artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.dmg_name }}
path: ${{ env.dmg_name }}.dmg
2 changes: 1 addition & 1 deletion src/kvirc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,6 @@ Plugins = Plugins\")
\"${plugin_dest_dir}/*.dylib\")
set(BU_CHMOD_BUNDLE_ITEMS ON)
include(BundleUtilities)
fixup_bundle(\"${CMAKE_INSTALL_PREFIX}\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\" IGNORE_ITEM Python)
fixup_bundle(\"${CMAKE_INSTALL_PREFIX}\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\" IGNORE_ITEM \"Python;libqsqlodbc.dylib;libqsqlpsql.dylib\")
" COMPONENT Runtime)
endif()

0 comments on commit cee30d0

Please sign in to comment.