chore: update the building script #74
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: build-daily | |
on: push | |
# schedule: | |
# - cron: '0 0 * * *' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
update-tag: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Update continuous tag | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Qsaker" | |
git tag -fa continuous -m "chore: update to latest commit" | |
git push origin :refs/tags/continuous | |
git push origin continuous -f | |
update-release: | |
runs-on: ubuntu-latest | |
needs: update-tag | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Delete Release | |
run: | | |
gh release delete continuous -y || true | |
- name: Create Release | |
run: | | |
gh release create continuous --title "Continuous Build" --notes "Daily build of QtSwissArmyKnife" | |
release-for-windows: | |
runs-on: windows-2019 | |
needs: update-release | |
if: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: '6.5.3' | |
target: 'desktop' | |
arch: 'win64_msvc2019_64' | |
dir: ${{ github.workspace }} | |
modules: 'qtcharts qtserialbus qtserialport qtwebsockets' | |
- name: Build for Windows | |
shell: cmd | |
run: | | |
mkdir build | |
cd build | |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 | |
cmake -DCMAKE_PREFIX_PATH='${{ github.workspace }}/Qt/6.5.3/win64_msvc2019_64/lib/cmake/Qt6' -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" ../ | |
cmake --build . --target QtSwissArmyKnife | |
dir && dir .\sak && dir .\sak\QtSwissArmyKnife | |
- name: Upload Release Asset for Windnows | |
run: | | |
dir && gh release upload continuous 'build\sak\qtswissarmyknife-windows-amd64.zip' | |
release-for-linux: | |
runs-on: ubuntu-20.04 | |
needs: update-release | |
if: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: '6.5.3' | |
target: 'desktop' | |
arch: 'gcc_64' | |
dir: ${{ github.workspace }} | |
modules: 'qtcharts qtserialbus qtserialport qtwebsockets' | |
- name: install-dependencies | |
run: | | |
sudo apt-get install -y libxcb-xinerama0 libxcb-cursor-dev | |
- name: Build for Linux | |
run: | | |
mkdir build | |
cd build | |
cmake ../ -DCMAKE_PREFIX_PATH='${{ github.workspace }}/Qt/6.5.3/gcc_64/lib/cmake/Qt6' -DCMAKE_BUILD_TYPE:STRING=Release -DSAK_ENABLE_LINUXDEPLOYQT:BOOL=TRUE -DSAK_ENABLE_LINUXDEPLOYQT_DOWNLOAD:BOOL=TRUE -G "Unix Makefiles" | |
cmake --build . --target QtSwissArmyKnife | |
dir && dir ./sak && dir ./sak/QtSwissArmyKnife | |
- name: Upload Release Asset for Linux | |
run: | | |
dir && gh release upload continuous 'build/qtswissarmyknife-linux-x86_64.AppImage' | |
release-for-macos: | |
runs-on: macos-11 | |
needs: update-release | |
steps: | |
- name: Checkout | |
if: false | |
uses: actions/checkout@v3 | |
- name: Install Qt | |
if: false | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: '6.5.3' | |
target: 'desktop' | |
arch: 'clang_64' | |
dir: ${{ github.workspace }} | |
modules: 'qtcharts qtserialbus qtserialport qtwebsockets' | |
- name: Build for macOS | |
# 278ERROR: no file at "/usr/local/opt/libiodbc/lib/libiodbc.2.dylib" | |
# brew unlink unixodbc | |
# brew install libiodbc | |
# ERROR: no file at "/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib" | |
run: | | |
echo "[fix]ERROR: no file at /usr/local/opt/libiodbc/lib/libiodbc.2.dylib" | |
brew unlink unixodbc | |
brew install libiodbc | |
brew install tree | |
tree /usr/local/Cellar/postgresql@14/14.10/lib/postgresql@14-L 2 | |
mkdir -p /Applications/Postgres.app/Contents/Versions/14/lib | |
ln -s /usr/local/Cellar/postgresql@14/14.10/lib/postgresql@14/libpq.5.14.dylib /Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib | |
mkdir build | |
cd build | |
cmake -DCMAKE_PREFIX_PATH='${{ github.workspace }}/Qt/6.5.3/clang_64/lib/cmake/Qt6' -DCMAKE_BUILD_TYPE:STRING=Release -G "Unix Makefiles" ../ | |
cmake --build . --target QtSwissArmyKnife | |
ls && ls ./sak && ls ./sak/QtSwissArmyKnife | |
- name: Upload Release Asset for macOS | |
run: | | |
dir && gh release upload continuous 'build/sak/QtSwissArmyKnife/qtswissarmyknife-macos-11.dmg' |