diff options
Diffstat (limited to '.github/workflows/win_release.yml')
| -rw-r--r-- | .github/workflows/win_release.yml | 157 |
1 files changed, 157 insertions, 0 deletions
diff --git a/.github/workflows/win_release.yml b/.github/workflows/win_release.yml new file mode 100644 index 0000000..1a5307d --- /dev/null +++ b/.github/workflows/win_release.yml @@ -0,0 +1,157 @@ +env: + QT_VERSION: '5.15.2' + SQLITE_VERSION: '3350400' + SQLITE_RELEASE_YEAR: '2021' + QT_ARCH: 'win64_mingw81' + MINGW_DIR: ../Qt/Tools/mingw810_64 + QT_BIN_DIR: ../Qt/5.15.2/mingw81_64/bin + PORTABLE_DIR: output/portable/SQLiteStudio + MINGW_URL: https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/tools_mingw/qt.tools.win64_mingw810/8.1.0-1-202004170606x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z + DEPS_URL: https://www.dropbox.com/s/2dpem7vy0ee19tu/win64_deps.zip?dl=1 + +name: Windows release build + +on: + repository_dispatch: + types: [win_release] + +jobs: + build: + runs-on: windows-2019 + + steps: + - name: Cache Qt + id: cache-qt + uses: actions/cache@v1 + with: + path: ${{ github.workspace }}\..\Qt + key: ${{ runner.os }}-${{ env.QT_VERSION }}-Qt-Cache + + - name: Install Qt + uses: jurplel/install-qt-action@v2 + with: + cached: ${{ steps.cache-qt.outputs.cache-hit }} + version: ${{ env.QT_VERSION }} + host: 'windows' + arch: ${{ env.QT_ARCH }} + # jurplel/install-qt-action has a bug due to which we cannot use ${{ github.workspace }} for the "dir" property, because it will fail. + dir: 'D:/' + modules: 'qtscript' + setup-python: 'false' + + - name: Install mingw + if: steps.cache-qt.outputs.cache-hit != 'true' + shell: bash + run: | + curl -L ${{ env.MINGW_URL }} --output ../mingw.7z + 7z x -o"../Qt" ../mingw.7z + echo "${{ env.MINGW_DIR }}/bin" >> $GITHUB_PATH + + - name: Clone repo + uses: actions/checkout@v2 + with: + ref: ${{ github.event.client_payload.branch }} + + - name: Install dependencies + shell: bash + run: | + curl -L ${{ env.DEPS_URL }} --output ../win64_deps.zip + 7z x -o".." ../win64_deps.zip + echo "../lib" >> $GITHUB_PATH + + - name: Install SQLite3 + shell: bash + run: | + cd .. + curl -L http://sqlite.org/$SQLITE_RELEASE_YEAR/sqlite-amalgamation-$SQLITE_VERSION.zip --output sqlite-amalgamation-$SQLITE_VERSION.zip + 7z x sqlite-amalgamation-$SQLITE_VERSION.zip + cd sqlite-amalgamation-$SQLITE_VERSION + gcc.exe sqlite3.c -Os -fpic -DWIN64 -m64 -I. -shared -o sqlite3.dll \ + -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT \ + -DSQLITE_ENABLE_DBSTAT_VTAB \ + -DSQLITE_ENABLE_BYTECODE_VTAB \ + -DSQLITE_ENABLE_COLUMN_METADATA \ + -DSQLITE_ENABLE_EXPLAIN_COMMENTS \ + -DSQLITE_ENABLE_FTS3 \ + -DSQLITE_ENABLE_FTS4 \ + -DSQLITE_ENABLE_FTS5 \ + -DSQLITE_ENABLE_GEOPOLY \ + -DSQLITE_ENABLE_JSON1 \ + -DSQLITE_ENABLE_RTREE \ + -DSQLITE_ENABLE_MATH_FUNCTIONS + cp -f sqlite3.dll ../lib/ + cp -f sqlite3.h ../include/ + cp -f sqlite3ext.h ../include/ + + - name: Prepare output dir + shell: bash + run: mkdir output output/build output/build/Plugins + + - name: Compile SQLiteStudio3 + working-directory: output/build + run: | + qmake.exe CONFIG+=portable ..\..\SQLiteStudio3 + mingw32-make.exe -j 2 + + - name: Compile Plugins + working-directory: output/build/Plugins + run: | + qmake.exe CONFIG+=portable ..\..\..\Plugins + mingw32-make.exe -j 2 + + - name: Prepare portable dir + shell: bash + working-directory: output + run: | + mkdir portable + cp -R SQLiteStudio portable/ + + - name: Clean-up portable dir + shell: bash + run: | + cd ${{ env.PORTABLE_DIR }} + rm -f *.a + rm -f plugins/*.a + rm -f styles/*.a + echo "ABSOLUTE_PORTABLE_DIR=`pwd`" >> $GITHUB_ENV + + - name: Prepare portable distro (Qt) + shell: bash + working-directory: ${{ env.Qt5_Dir }} + run: | + for f in Qt5Core Qt5Gui Qt5Network Qt5PrintSupport Qt5Script Qt5Svg Qt5Widgets Qt5Xml libgcc_s_seh-1 libstdc++-6 libwinpthread-1; do cp bin/$f.dll "$ABSOLUTE_PORTABLE_DIR"; done + cp bin/qt.conf "$ABSOLUTE_PORTABLE_DIR" + mkdir -p "$ABSOLUTE_PORTABLE_DIR/iconengines" + mkdir -p "$ABSOLUTE_PORTABLE_DIR/platforms" + mkdir -p "$ABSOLUTE_PORTABLE_DIR/printsupport" + mkdir -p "$ABSOLUTE_PORTABLE_DIR/styles" + mkdir -p "$ABSOLUTE_PORTABLE_DIR/imageformats" + cp plugins/iconengines/qsvgicon.dll "$ABSOLUTE_PORTABLE_DIR/iconengines" + cp plugins/platforms/qwindows.dll "$ABSOLUTE_PORTABLE_DIR/platforms" + cp plugins/styles/qwindowsvistastyle.dll "$ABSOLUTE_PORTABLE_DIR/styles" + cp plugins/printsupport/windowsprintersupport.dll "$ABSOLUTE_PORTABLE_DIR/printsupport" + for f in qgif qicns qico qjpeg qsvg qtga qtiff qwbmp; do cp plugins/imageformats/$f.dll "$ABSOLUTE_PORTABLE_DIR/imageformats"; done + + - name: Prepare portable distro (Deps) + shell: bash + run: | + cd ../lib + cp *.dll "$ABSOLUTE_PORTABLE_DIR" + + - name: Determine SQLiteStudio version + shell: bash + run: | + cd $ABSOLUTE_PORTABLE_DIR + echo "SQLITESTUDIO_VERSION=$(./sqlitestudiocli.exe --version | cut -f 2 -d ' ')" >> $GITHUB_ENV + + - name: Assemble portable package + shell: bash + run: | + cd $ABSOLUTE_PORTABLE_DIR/.. + 7z a -r sqlitestudio-$SQLITESTUDIO_VERSION.zip SQLiteStudio + + - name: Upload package artifact + uses: actions/upload-artifact@v1 + with: + name: sqlitestudio-${{ env.SQLITESTUDIO_VERSION }}.zip + path: output/portable/sqlitestudio-${{ env.SQLITESTUDIO_VERSION }}.zip |
