Skip to content
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
101 changes: 101 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Build

on:
push:
pull_request:

jobs:
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
qt_arch: gcc_64
- os: macos-latest
qt_arch: clang_64
- os: windows-latest
qt_arch: win64_msvc2019_64

steps:
- name: Check out source
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
cache: false

- name: Install Qt (Linux)
if: runner.os == 'Linux'
uses: jurplel/install-qt-action@v4
with:
version: '5.15.2'
host: linux
target: desktop
arch: ${{ matrix.qt_arch }}
install-deps: true
cache: true

- name: Install Qt (macOS)
if: runner.os == 'macOS'
uses: jurplel/install-qt-action@v4
with:
version: '5.15.2'
host: mac
target: desktop
arch: ${{ matrix.qt_arch }}
cache: true

- name: Install Qt (Windows)
if: runner.os == 'Windows'
uses: jurplel/install-qt-action@v4
with:
version: '5.15.2'
host: windows
target: desktop
arch: ${{ matrix.qt_arch }}
cache: true

- name: Set up MSVC
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.29

- name: Configure (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
mkdir -p build-ci
cd build-ci
qmake ../liteidex CONFIG+=release

- name: Configure (macOS)
if: runner.os == 'macOS'
shell: bash
run: |
mkdir -p build-ci
cd build-ci
qmake ../liteidex CONFIG+=release 'QMAKE_LIBS_OPENGL=-framework OpenGL'

- name: Configure (Windows)
if: runner.os == 'Windows'
shell: cmd
run: |
if not exist build-ci mkdir build-ci
cd build-ci
qmake ..\liteidex CONFIG+=release CONFIG-=precompile_header

- name: Compile (Unix)
if: runner.os != 'Windows'
shell: bash
run: make -C build-ci -j2

- name: Compile (Windows)
if: runner.os == 'Windows'
shell: cmd
run: nmake /f build-ci\Makefile
37 changes: 22 additions & 15 deletions build/build_linux_qt5.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/sh

export BUILD_ROOT=$PWD
export BUILD_ROOT="$PWD"

if [ -z $LITEIDE_ROOT ]; then
export LITEIDE_ROOT=$PWD/../liteidex
if [ -z "$LITEIDE_ROOT" ]; then
export LITEIDE_ROOT="$PWD/../liteidex"
fi

echo build liteide
Expand All @@ -12,11 +12,18 @@ echo BUILD_ROOT=$BUILD_ROOT
echo LITEIDE_ROOT=$LITEIDE_ROOT
echo .

export PATH=$QTDIR/bin:$PATH
if [ -n "$QTDIR" ]; then
export PATH="$QTDIR/bin:$PATH"
fi

if ! command -v qmake >/dev/null 2>&1; then
echo 'error, qmake not found in PATH'
exit 1
fi

echo qmake liteide ...
echo .
qtchooser -qt=qt5 -run-tool=qmake $LITEIDE_ROOT -spec linux-g++ "CONFIG+=release"
qtchooser -qt=qt5 -run-tool=qmake "$LITEIDE_ROOT" -spec linux-g++ "CONFIG+=release"

if [ $? -ge 1 ]; then
echo 'error, qmake fail'
Expand All @@ -39,12 +46,12 @@ if [ $? -ge 1 ]; then
fi

echo build liteide tools ...
cd $LITEIDE_ROOT
cd "$LITEIDE_ROOT" || exit 1

if [ -z $GOPATH ]; then
export GOPATH=$PWD
if [ -z "$GOPATH" ]; then
export GOPATH="$PWD"
else
export GOPATH=$PWD:$GOPATH
export GOPATH="$PWD:$GOPATH"
fi

#(cd "$PWD/src/github.com/visualfc/gotools" && go install -ldflags "-s" -v)
Expand All @@ -67,18 +74,18 @@ fi

echo deploy ...

cd $BUILD_ROOT
cd "$BUILD_ROOT" || exit 1

rm -r liteide
rm -rf liteide
mkdir -p liteide
mkdir -p liteide/bin
mkdir -p liteide/share/liteide
mkdir -p liteide/lib/liteide/plugins

cp -a -v $LITEIDE_ROOT/LICENSE.LGPL liteide
cp -a -v $LITEIDE_ROOT/LGPL_EXCEPTION.TXT liteide
cp -a -v $LITEIDE_ROOT/../README.md liteide
cp -a -v $LITEIDE_ROOT/../CONTRIBUTORS liteide
cp -a -v "$LITEIDE_ROOT/LICENSE.LGPL" liteide
cp -a -v "$LITEIDE_ROOT/LGPL_EXCEPTION.TXT" liteide
cp -a -v "$LITEIDE_ROOT/../README.md" liteide
cp -a -v "$LITEIDE_ROOT/../CONTRIBUTORS" liteide

cp -a -v $LITEIDE_ROOT/liteide/bin/liteide liteide/bin
cp -a -v $LITEIDE_ROOT/bin/gotools liteide/bin
Expand Down
31 changes: 16 additions & 15 deletions build/build_macos_qt5.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/sh

export BUILD_ROOT=$PWD
export BUILD_ROOT="$PWD"

if [ -z $LITEIDE_ROOT ]; then
export LITEIDE_ROOT=$PWD/../liteidex
if [ -z "$LITEIDE_ROOT" ]; then
export LITEIDE_ROOT="$PWD/../liteidex"
fi

echo build liteide
Expand All @@ -12,16 +12,18 @@ echo BUILD_ROOT=$BUILD_ROOT
echo LITEIDE_ROOT=$LITEIDE_ROOT
echo .

if [ -z $QTDIR ]; then
echo 'error, QTDIR is null'
exit 1
if [ -n "$QTDIR" ]; then
export PATH="$QTDIR/bin:$PATH"
fi

export PATH=$QTDIR/bin:$PATH
if ! command -v qmake >/dev/null 2>&1; then
echo 'error, qmake not found in PATH'
exit 1
fi

echo qmake liteide ...
echo .
qmake $LITEIDE_ROOT -spec macx-clang CONFIG+=X86_64
qmake "$LITEIDE_ROOT" -spec macx-clang "CONFIG+=release"

if [ $? -ge 1 ]; then
echo 'error, qmake fail'
Expand All @@ -44,13 +46,13 @@ if [ $? -ge 1 ]; then
fi

echo build liteide tools ...
cd $LITEIDE_ROOT
cd "$LITEIDE_ROOT" || exit 1


if [ -z $GOPATH ]; then
export GOPATH=$PWD
if [ -z "$GOPATH" ]; then
export GOPATH="$PWD"
else
export GOPATH=$PWD:$GOPATH
export GOPATH="$PWD:$GOPATH"
fi

#(cd "$PWD/src/github.com/visualfc/gotools" && go install -ldflags "-s" -v)
Expand All @@ -72,9 +74,9 @@ fi

echo deploy ...

cd $BUILD_ROOT
cd "$BUILD_ROOT" || exit 1

rm -r liteide
rm -rf liteide
mkdir -p liteide

cp -R -v $LITEIDE_ROOT/liteide/bin/LiteIDE.app liteide
Expand All @@ -91,4 +93,3 @@ cp -R -v $LITEIDE_ROOT/bin/gocode liteide/LiteIDE.app/Contents/MacOS
cp -R -v $LITEIDE_ROOT/bin/gomodifytags liteide/LiteIDE.app/Contents/MacOS
cp -R -v $LITEIDE_ROOT/deploy/* liteide/LiteIDE.app/Contents/Resources
cp -R -v $LITEIDE_ROOT/os_deploy/macosx/* liteide/LiteIDE.app/Contents/Resources

Loading
Loading