This commit is contained in:
Alex Spataru 2021-02-04 16:45:02 -05:00
commit 502f3e0d80

View File

@ -12,6 +12,8 @@ on:
paths-ignore: # File-patterns to ignore paths-ignore: # File-patterns to ignore
- '**.md' # Ignore changes to *.md files - '**.md' # Ignore changes to *.md files
workflow_dispatch:
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
# Define application name & version # Define application name & version
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
@ -29,234 +31,168 @@ env:
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
jobs: jobs:
#
# GNU/Linux build (we run on Ubuntu 16.04 to generate AppImage) # GNU/Linux build (we run on Ubuntu 16.04 to generate AppImage)
#
build-linux: build-linux:
runs-on: ubuntu-16.04 runs-on: ubuntu-16.04
name: '🐧 Ubuntu 16.04'
steps: steps:
#
# Checkout the repository
#
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive
# - name: '🧰 Checkout'
# Cache Qt uses: actions/checkout@v2
# with:
- name: Cache Qt submodules: recursive
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: ${{runner.os}}-QtCache
# - name: '⚙️ Cache Qt'
# Install Qt id: cache-qt
# uses: actions/cache@v1
- name: Install Qt with:
uses: jurplel/install-qt-action@v2 path: ../Qt
with: key: ${{runner.os}}-QtCache
modules: qtcharts
cached: ${{steps.cache-qt.outputs.cache-hit}}
# - name: '⚙️ Install Qt'
# Install additional dependencies, stolen from: uses: jurplel/install-qt-action@v2
# https://github.com/mapeditor/tiled/blob/master/.github/workflows/packages.yml with:
# modules: qtcharts
- name: Install dependencies cached: ${{steps.cache-qt.outputs.cache-hit}}
run: |
sudo apt-get update
sudo apt-get install libgl1-mesa-dev libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libzstd-dev
# # Install additional dependencies, stolen from:
# Compile the application # https://github.com/mapeditor/tiled/blob/master/.github/workflows/packages.yml
# - name: '⚙️ Install dependencies'
- name: Compile run: |
run: | sudo apt-get update
qmake ${{env.QMAKE_PROJECT}} CONFIG+=release PREFIX=/usr sudo apt-get install libgl1-mesa-dev libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libzstd-dev
make -j8
# - name: '🚧 Compile application'
# Create the AppImage run: |
# qmake ${{env.QMAKE_PROJECT}} CONFIG+=release PREFIX=/usr
- name: Create AppImage make -j8
run: |
make INSTALL_ROOT=appdir install
wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" -O linuxdeployqt
chmod a+x linuxdeployqt
./linuxdeployqt appdir/usr/share/applications/*.desktop -appimage -bundle-non-qt-libs -extra-plugins=imageformats/libqsvg.so -qmldir="${{env.QML_DIR_NIX}}"
# - name: '📦 Create AppImage'
# Rename AppImage to match "%AppName%-%Version%-Linux.AppImage" format run: |
# make INSTALL_ROOT=appdir install
- name: Rename AppImage
run: mv *.AppImage ${{env.EXECUTABLE}}-${{env.VERSION}}-Linux.AppImage wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" -O linuxdeployqt
chmod a+x linuxdeployqt
./linuxdeployqt appdir/usr/share/applications/*.desktop -appimage -bundle-non-qt-libs -extra-plugins=imageformats/libqsvg.so -qmldir="${{env.QML_DIR_NIX}}"
# Rename AppImage to match "%AppName%-%Version%-Linux.AppImage" format
mv *.AppImage ${{env.EXECUTABLE}}-${{env.VERSION}}-Linux.AppImage
- name: '📤 Upload artifact: AppImage'
uses: actions/upload-artifact@v2
with:
name: ${{env.EXECUTABLE}}-${{env.VERSION}}-Linux.AppImage
path: ${{env.EXECUTABLE}}-${{env.VERSION}}-Linux.AppImage
#
# Upload AppImage to build artifacts
#
- name: Upload AppImage
uses: actions/upload-artifact@v2
with:
name: ${{env.EXECUTABLE}}-${{env.VERSION}}-Linux.AppImage
path: ${{env.EXECUTABLE}}-${{env.VERSION}}-Linux.AppImage
#
# macOS build # macOS build
#
build-mac: build-mac:
runs-on: macos-latest runs-on: macos-latest
name: '🍎 macOS'
steps: steps:
#
# Checkout the repository
#
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive
# - name: '🧰 Checkout'
# Cache Qt uses: actions/checkout@v2
# with:
- name: Cache Qt submodules: recursive
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: ${{runner.os}}-QtCache
# - name: '⚙️ Cache Qt'
# Install Qt id: cache-qt
# uses: actions/cache@v1
- name: Install Qt with:
uses: jurplel/install-qt-action@v2 path: ../Qt
with: key: ${{runner.os}}-QtCache
modules: qtcharts
cached: ${{steps.cache-qt.outputs.cache-hit}}
# - name: '⚙️ Install Qt'
# Compile application uses: jurplel/install-qt-action@v2
# with:
- name: Compile modules: qtcharts
run: | cached: ${{steps.cache-qt.outputs.cache-hit}}
qmake ${{env.QMAKE_PROJECT}} CONFIG+=release
make -j8
# - name: '🚧 Compile application'
# Deploy application run: |
# qmake ${{env.QMAKE_PROJECT}} CONFIG+=release
- name: Deploy app make -j8
run: |
macdeployqt ${{env.EXECUTABLE}}.app -qmldir="${{env.QML_DIR_NIX}}"
mv "${{env.EXECUTABLE}}.app" "${{env.APPLICATION}}.app"
# - name: '📦 Package application (macdeployqt and zipfile)'
# ZIP application "%AppName%-%Version%-macOS.zip" run: |
# We use ditto instead of zip to use the same commands as Finder macdeployqt ${{env.EXECUTABLE}}.app -qmldir="${{env.QML_DIR_NIX}}"
# mv "${{env.EXECUTABLE}}.app" "${{env.APPLICATION}}.app"
- name: Create ZIP file
run: | # ZIP application "%AppName%-%Version%-macOS.zip"
ditto -c -k --sequesterRsrc --keepParent "${{env.APPLICATION}}.app" ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS.zip # We use ditto instead of zip to use the same commands as Finder
ditto -c -k --sequesterRsrc --keepParent "${{env.APPLICATION}}.app" ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS.zip
- name: '📤 Upload artifact: ZIP'
uses: actions/upload-artifact@v2
with:
name: ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS.zip
path: ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS.zip
#
# Upload ZIP to build artifacts
#
- name: Upload ZIP
uses: actions/upload-artifact@v2
with:
name: ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS.zip
path: ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS.zip
#
# Windows build # Windows build
#
build-windows: build-windows:
runs-on: windows-latest runs-on: windows-latest
name: '🧊 Windows'
steps: steps:
#
# Checkout the repository
#
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive
# - name: '🧰 Checkout'
# Configure MSVC uses: actions/checkout@v2
# with:
- name: Configure MSVC submodules: recursive
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
spectre: true
# - name: '⚙️ Configure MSVC'
# Cache Qt uses: ilammy/msvc-dev-cmd@v1
# with:
- name: Cache Qt arch: x64
id: cache-qt spectre: true
uses: actions/cache@v1
with:
path: ../Qt
key: ${{runner.os}}-QtCache
# - name: '⚙️ Cache Qt'
# Install Qt id: cache-qt
# uses: actions/cache@v1
- name: Install Qt with:
uses: jurplel/install-qt-action@v2 path: ../Qt
with: key: ${{runner.os}}-QtCache
modules: qtcharts
cached: ${{steps.cache-qt.outputs.cache-hit}}
# - name: '⚙️ Install Qt'
# Install NSIS uses: jurplel/install-qt-action@v2
# with:
- name: Install NSIS modules: qtcharts
run: | cached: ${{steps.cache-qt.outputs.cache-hit}}
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
scoop bucket add extras
scoop install nsis
# - name: '⚙️ Install NSIS'
# Compile application run: |
# Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
- name: Compile scoop bucket add extras
run: | scoop install nsis
qmake ${{env.QMAKE_PROJECT}} CONFIG+=release
nmake
# - name: '🚧 Compile application'
# Copy Qt & OpenSSL DLLs, compiler runtime & application icon run: |
# qmake ${{env.QMAKE_PROJECT}} CONFIG+=release
- name: Deploy nmake
run: |
mkdir bin
move release/${{env.EXECUTABLE}}.exe bin
windeployqt bin/${{env.EXECUTABLE}}.exe -qmldir="${{env.QML_DIR_WIN}}" --compiler-runtime
mkdir "${{env.APPLICATION}}"
move bin "${{env.APPLICATION}}"
xcopy deploy\windows\resources\icon.ico "${{env.APPLICATION}}"
xcopy deploy\windows\openssl\*.dll "${{env.APPLICATION}}\bin"
# # Copy Qt DLLs, compiler runtime & application icon
# Create NSIS installer - name: '📦 Package application (windeployqt)'
# run: |
- name: Make NSIS installer mkdir bin
run: | move release/${{env.EXECUTABLE}}.exe bin
move "${{env.APPLICATION}}" deploy\windows\nsis\ windeployqt bin/${{env.EXECUTABLE}}.exe -qmldir="${{env.QML_DIR_WIN}}" --compiler-runtime
cd deploy\windows\nsis mkdir "${{env.APPLICATION}}"
makensis /X"SetCompressor /FINAL lzma" setup.nsi move bin "${{env.APPLICATION}}"
ren *.exe ${{env.EXECUTABLE}}-${{env.VERSION}}-Windows.exe xcopy deploy\windows\resources\icon.ico "${{env.APPLICATION}}"
xcopy deploy\windows\openssl\*.dll "${{env.APPLICATION}}\bin"
# - name: '📦 Make NSIS installer'
# Upload installer to build artifacts run: |
# move "${{env.APPLICATION}}" deploy\windows\nsis\
- name: Upload NSIS installer cd deploy\windows\nsis
uses: actions/upload-artifact@v2 makensis /X"SetCompressor /FINAL lzma" setup.nsi
with: ren *.exe ${{env.EXECUTABLE}}-${{env.VERSION}}-Windows.exe
name: ${{env.EXECUTABLE}}-${{env.VERSION}}-Windows.exe
path: deploy/windows/nsis/${{env.EXECUTABLE}}-${{env.VERSION}}-Windows.exe - name: '📤 Upload artifact: NSIS installer'
uses: actions/upload-artifact@v2
with:
name: ${{env.EXECUTABLE}}-${{env.VERSION}}-Windows.exe
path: deploy/windows/nsis/${{env.EXECUTABLE}}-${{env.VERSION}}-Windows.exe