[fix] cli: fix database driver loading for windows #640
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: FastTrack_build | |
on: | |
push: | |
branches: [master] | |
env: | |
QT_VERSION: 6.5.2 | |
OPENCV_VERSION: 4.8.0 | |
OPENCV_VERSION_: 480 | |
jobs: | |
build_linux: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: install_opencv | |
run: | | |
sudo apt-get update | |
sudo apt-get dist-upgrade | |
sudo apt-get install mesa-common-dev libgl1-mesa-dev libssl-dev | |
sudo apt-get install libxcb-* | |
sudo apt-get install libxkb-* | |
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libnss3 | |
sudo apt-get install libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev | |
sudo apt-get install libopencv-dev | |
- name: install_qt6 | |
run: | | |
pip install aqtinstall | |
python3 -m aqt install-qt -O ${{ github.workspace }}/Qt/ linux desktop ${{ env.QT_VERSION }} | |
echo ${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/gcc_64/bin/ >> $GITHUB_PATH | |
- name: build_ft | |
run: | | |
./run.sh ci | |
- name: build_appimage | |
run: | | |
cd build | |
wget -O deploy.AppImage https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage | |
mkdir appdir | |
cp ../sh.fasttrack.fasttrack.desktop appdir | |
cp ../src/assets/fasttrack.png appdir | |
cp fasttrack appdir | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/gcc_64/lib/ | |
chmod +x deploy.AppImage | |
./deploy.AppImage appdir/fasttrack -bundle-non-qt-libs -unsupported-allow-new-glibc -qmake=${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/gcc_64/bin/qmake6 -extra-plugins=platforms/,sqldrivers/ -exclude-libs=libgmodule-2.0.so | |
mkdir -p appdir/usr/share/fasttrack/ | |
cp *.qm appdir/usr/share/fasttrack | |
wget -O tool.AppImage https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage | |
chmod +x tool.AppImage | |
./tool.AppImage appdir/ | |
- name: upload_artefact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: FastTrack-x86_64.AppImage | |
path: ./build/FastTrack-x86_64.AppImage | |
build_win: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: install_qt | |
run: | | |
choco uninstall mingw | |
pip install aqtinstall | |
python3 -m aqt install-qt -m qtcharts -O ${{ github.workspace }}/Qt/ windows desktop ${{ env.QT_VERSION }} win64_mingw | |
python3 -m aqt install-tool -O ${{ github.workspace }}/Qt/ windows desktop tools_mingw90 | |
echo "${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/mingw_64/bin/" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
echo "${{ github.workspace }}/Qt/Tools/mingw1120_64/bin/" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- name: install_opencv | |
run: | | |
choco install wget unzip | |
wget https://github.com/FastTrackOrg/Windows_MinGW_64_OpenCV/releases/download/${{ env.OPENCV_VERSION }}/OpenCV_MinGW_64.zip | |
unzip OpenCV_MinGW_64.zip -d ${{ github.workspace }} | |
- name: build_ft | |
run: | | |
cd src/ | |
qmake FastTrack.pro -spec win32-g++ CONFIG+=release | |
mingw32-make | |
cd build/ | |
mkdir FastTrack | |
cp FastTrack.exe FastTrack | |
windeployqt FastTrack/FastTrack.exe --no-translations # https://bugreports.qt.io/browse/QTBUG-62103?jql=status%20%3D%20Open%20AND%20text%20~%20%22windeployqt%20platform%22 and https://bugreports.qt.io/browse/QTBUG-112204 | |
cp ..\assets\icon.ico FastTrack | |
cp ${{ github.workspace }}/Qt/Tools/mingw*/bin/libgomp-1.dll FastTrack | |
cp ${{ github.workspace }}/OpenCV_MinGW_64/bin/opencv_videoio_ffmpeg${{ env.OPENCV_VERSION_ }}_64.dll FastTrack | |
cp ${{ github.workspace }}/OpenCV_MinGW_64/bin/libopencv_world${{ env.OPENCV_VERSION_ }}.dll FastTrack | |
cp *.qm FastTrack | |
- name: upload_artefact | |
uses: actions/upload-artifact@v1 | |
with: | |
name: FastTrack | |
path: src/build/FastTrack | |
build_mac: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: install_qt | |
run: | | |
pip install aqtinstall | |
python3 -m aqt install-qt -m qtcharts -O ${{ github.workspace }}/Qt/ mac desktop ${{ env.QT_VERSION }} | |
echo ${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/macos/bin/ >> $GITHUB_PATH | |
- name: Set up Homebrew #https://github.com/Homebrew/homebrew-cask/issues/150323 | |
id: set-up-homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- name: install_opencv | |
run: | | |
rm -f /usr/local/bin/2to3* | |
rm -f /usr/local/bin/idle3* | |
rm -f /usr/local/bin/pydoc3* | |
rm -f /usr/local/bin/python3* | |
rm -f /usr/local/opt/go/bin/go* | |
rm -f /usr/local/bin/go* | |
brew update -q -f | |
brew upgrade -q -f | |
brew install pkg-config | |
brew install openssl | |
brew unlink unixodbc | |
brew install libiodbc | |
brew tap FastTrackOrg/fasttrack | |
brew install --build-from-source FastTrackOrg/fasttrack/opencv | |
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ | |
- name: build_ft | |
run: | | |
qmake src/FastTrack.pro CONFIG+=release | |
make | |
cd build/ | |
macdeployqt FastTrack.app -always-overwrite | |
wget https://raw.githubusercontent.com/tamlok/macdeployqtfix/master/macdeployqtfix.py | |
cp *.qm FastTrack.app/Contents/Resources/ | |
python macdeployqtfix.py FastTrack.app/Contents/MacOS/FastTrack ../../Qt/${{ env.QT_VERSION }}/ | |
hdiutil create -volname FastTrack -srcfolder FastTrack.app -ov -format UDZO FastTrack.dmg | |
- name: upload_artefact | |
uses: actions/upload-artifact@v1 | |
with: | |
name: FastTrack.dmg | |
path: ./build/FastTrack.dmg | |
upload_builds: | |
needs: [build_linux, build_win, build_mac] | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: create_dir | |
run: | | |
mkdir ./tmp/ | |
- uses: actions/download-artifact@v2 | |
with: | |
path: ./tmp/ | |
- name: install_SSH_key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.KEY }} | |
known_hosts: ${{ secrets.HOST }} | |
- name: upload_builds_to_server | |
run: | | |
cd tmp/FastTrack/ | |
zip -r FastTrack.zip ./* | |
cd .. | |
mkdir rel/ | |
mv FastTrack/FastTrack.zip ./rel | |
rm -r ./FastTrack | |
cp FastTrack*/* ./rel | |
rsync ./rel/* ${{ secrets.USER }}@${{ secrets.ADDRESS }}:${{ secrets.PATH }} |