397 lines
13 KiB
YAML
Raw Normal View History

2024-11-03 01:19:35 -05:00
#-------------------------------------------------------------------------------
2021-01-11 00:18:30 -05:00
# Workflow configuration
2024-11-03 01:19:35 -05:00
#-------------------------------------------------------------------------------
2021-01-11 00:18:30 -05:00
name: Deploy
2024-09-18 22:00:46 -05:00
2021-01-10 22:39:23 -05:00
on:
2021-01-11 00:18:30 -05:00
push: # Run on push
paths-ignore: # File patterns to ignore
- '**.md' # Ignore changes to *.md files
2021-02-04 06:42:14 +01:00
2021-01-11 00:18:30 -05:00
pull_request: # Run on pull-request
paths-ignore: # File-patterns to ignore
- '**.md' # Ignore changes to *.md files
2024-11-03 01:19:35 -05:00
#-------------------------------------------------------------------------------
2021-01-11 00:18:30 -05:00
# Define application name & version
2024-11-03 01:19:35 -05:00
#-------------------------------------------------------------------------------
2021-01-11 00:18:30 -05:00
env:
2024-11-05 00:11:25 -05:00
VERSION: "3.0.4"
QT_VERSION_LINUX: 6.8.0
QT_VERSION_MACOS: 6.8.0
QT_VERSION_WINDOWS: 6.8.0
2024-09-18 22:00:46 -05:00
EXECUTABLE: "Serial-Studio"
APPLICATION: "Serial Studio"
2021-10-01 00:26:54 -07:00
UNIXNAME: "serial-studio"
2024-09-18 22:00:46 -05:00
QML_DIR: "../../app/qml"
2021-10-01 02:56:07 -05:00
PUBLISHER: "Alex Spataru"
2024-11-06 15:59:36 -05:00
DESCRIPTION: "Multi-purpose serial data visualization & processing program"
2024-10-27 06:09:49 -05:00
QT_MODULES: qtserialport qtconnectivity qtpositioning qtlocation qtgraphs qtquick3d qt3d qtdatavis3d qtshadertools
2024-11-03 01:19:35 -05:00
#-------------------------------------------------------------------------------
2021-01-11 00:18:30 -05:00
# Workflow jobs (GNU/Linux, macOS & Windows)
2024-11-03 01:19:35 -05:00
#-------------------------------------------------------------------------------
2021-01-11 00:18:30 -05:00
2020-12-24 23:29:05 -06:00
jobs:
#
2024-09-18 22:00:46 -05:00
# Linux build
#
2020-12-24 23:34:12 -06:00
build-linux:
2024-11-06 15:59:36 -05:00
runs-on: ubuntu-22.04
name: '🐧 Ubuntu 22.04'
2020-12-24 23:29:05 -06:00
steps:
2021-02-04 06:42:14 +01:00
- name: '🧰 Checkout'
2024-04-01 02:42:21 -05:00
uses: actions/checkout@v4
2024-09-18 22:00:46 -05:00
2021-02-04 06:42:14 +01:00
- name: '⚙️ Install Qt'
2024-10-09 10:37:12 -05:00
uses: jurplel/install-qt-action@v4
2021-02-04 06:42:14 +01:00
with:
2024-09-18 22:00:46 -05:00
version: ${{env.QT_VERSION_LINUX}}
2023-01-22 07:44:34 -06:00
modules: ${{env.QT_MODULES}}
2024-04-01 02:42:21 -05:00
cache: true
install-deps: 'true'
2021-02-04 06:42:14 +01:00
- name: '⚙️ Install dependencies'
run: |
sudo apt-get update
sudo apt-get install -y \
libcups2-dev \
libgl1-mesa-dev \
libxkbcommon-x11-0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-render-util0 \
libxcb-xinerama0 \
libzstd-dev \
libxcb-image0-dev \
libxcb-util0-dev \
libxcb-cursor-dev \
libssl-dev \
2024-11-06 15:59:36 -05:00
libudev-dev \
rpm \
libfuse2 \
fakeroot
2024-09-18 22:00:46 -05:00
- name: '⚙️ Install CMake'
uses: lukka/get-cmake@latest
with:
useLocalCache: true
- name: '🚧 Configure with CMake'
2021-02-04 06:42:14 +01:00
run: |
2024-09-18 22:00:46 -05:00
mkdir build
cd build
cmake ../ -DCMAKE_BUILD_TYPE=Release
- name: '🚧 Build application'
run: |
cd build
2024-10-13 01:21:33 -05:00
cmake --build . --config Release -j 16
2021-02-04 06:42:14 +01:00
2024-11-06 15:59:36 -05:00
- name: '📦 Create AppImage'
2021-02-04 06:42:14 +01:00
run: |
2024-09-18 22:00:46 -05:00
cd "build/app"
2024-11-06 15:59:36 -05:00
wget https://github.com/dantti/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget https://github.com/dantti/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
2022-05-01 20:27:20 -05:00
chmod +x linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-plugin-qt-x86_64.AppImage
2024-11-06 15:59:36 -05:00
2024-09-18 22:00:46 -05:00
export QML_SOURCES_PATHS="${{env.QML_DIR}}"
export QMAKE=/home/runner/work/${{env.EXECUTABLE}}/Qt/${{env.QT_VERSION_LINUX}}/gcc_64/bin/qmake
export PATH=/home/runner/work/${{env.EXECUTABLE}}/Qt/${{env.QT_VERSION_LINUX}}/gcc_64/libexec:$PATH
2024-11-06 15:59:36 -05:00
2024-11-06 16:12:31 -05:00
./linuxdeploy-x86_64.AppImage --appdir AppDir -e ${{env.UNIXNAME}} -i ../../app/deploy/linux/${{env.UNIXNAME}}.png -d ../../app/deploy/linux/${{env.UNIXNAME}}.desktop --plugin qt --output appimage
2024-11-06 15:59:36 -05:00
2022-05-01 20:27:20 -05:00
rm linuxdeploy-x86_64.AppImage
rm linuxdeploy-plugin-qt-x86_64.AppImage
2024-11-06 15:59:36 -05:00
mv *.AppImage ../../${{env.EXECUTABLE}}-${{env.VERSION}}-Linux-x86_64.AppImage
- name: '📦 Create Native Packages'
run: |
cd "build/app"
export LDNP_DESCRIPTION="${{env.DESCRIPTION}}"
wget https://github.com/linuxdeploy/linuxdeploy-plugin-native_packages/releases/download/continuous/linuxdeploy-plugin-native_packages-x86_64.AppImage
chmod +x linuxdeploy-plugin-native_packages-x86_64.AppImage
fakeroot ./linuxdeploy-plugin-native_packages-x86_64.AppImage --appdir AppDir --build deb
fakeroot ./linuxdeploy-plugin-native_packages-x86_64.AppImage --appdir AppDir --build rpm
rm -rf AppDir
rm linuxdeploy-plugin-native_packages-x86_64.AppImage
mv *.deb ../../${{env.EXECUTABLE}}-${{env.VERSION}}-Linux-x86_64.deb
mv *.rpm ../../${{env.EXECUTABLE}}-${{env.VERSION}}-Linux-x86_64.rpm
2024-09-18 22:00:46 -05:00
2021-10-19 20:40:02 -05:00
- name: '📤 Upload artifact: AppImage'
uses: actions/upload-artifact@v4
2021-10-01 02:01:49 -05:00
with:
2024-11-06 15:59:36 -05:00
name: ${{env.EXECUTABLE}}-${{env.VERSION}}-Linux-x86_64.AppImage
path: ${{env.EXECUTABLE}}-${{env.VERSION}}-Linux-x86_64.AppImage
- name: '📤 Upload artifact: Debian Package'
uses: actions/upload-artifact@v4
with:
name: ${{env.EXECUTABLE}}-${{env.VERSION}}-Linux-x86_64.deb
path: ${{env.EXECUTABLE}}-${{env.VERSION}}-Linux-x86_64.deb
- name: '📤 Upload artifact: RPM Package'
uses: actions/upload-artifact@v4
with:
name: ${{env.EXECUTABLE}}-${{env.VERSION}}-Linux-x86_64.rpm
path: ${{env.EXECUTABLE}}-${{env.VERSION}}-Linux-x86_64.rpm
2021-02-04 06:42:14 +01:00
#
2024-11-07 15:05:02 -05:00
# macOS (aarch64) build
#
2024-11-07 15:05:02 -05:00
build-mac-aarch64:
2024-04-01 02:42:21 -05:00
runs-on: macos-latest
2024-11-07 15:05:02 -05:00
name: '🍎 macOS (aarch64)'
2020-12-25 21:17:44 -06:00
steps:
2021-02-04 06:42:14 +01:00
- name: '🧰 Checkout'
2024-04-01 02:42:21 -05:00
uses: actions/checkout@v4
2021-02-04 06:42:14 +01:00
- name: '⚙️ Install Qt'
2024-10-09 10:37:12 -05:00
uses: jurplel/install-qt-action@v4
2021-02-04 06:42:14 +01:00
with:
2024-09-18 22:00:46 -05:00
version: ${{env.QT_VERSION_MACOS}}
2023-01-22 07:44:34 -06:00
modules: ${{env.QT_MODULES}}
arch: clang_64
2024-09-18 22:00:46 -05:00
cache: 'true'
2024-09-18 22:00:46 -05:00
- name: '⚙️ Install CMake'
uses: lukka/get-cmake@latest
2021-02-04 06:42:14 +01:00
with:
2024-09-18 22:00:46 -05:00
useLocalCache: true
2024-05-05 01:55:11 -05:00
- name: '⚙️ Install Node'
uses: actions/setup-node@v4
with:
node-version: 20
2024-09-18 22:00:46 -05:00
- name: '🚧 Configure with CMake'
2024-05-05 01:55:11 -05:00
run: |
2024-09-18 22:00:46 -05:00
mkdir build
cd build
cmake ../ -DCMAKE_BUILD_TYPE=Release
- name: '🚧 Build application'
run: |
cd build
2024-10-13 01:21:33 -05:00
cmake --build . --config Release -j 16
2024-05-05 01:55:11 -05:00
- name: '📦 Package application'
run: |
2024-09-18 22:00:46 -05:00
cd build
cpack --verbose
2024-05-05 01:55:11 -05:00
- name: '🪪 Import Code Signing Certificate'
uses: apple-actions/import-codesign-certs@v2
with:
p12-file-base64: ${{secrets.CERTIFICATES_P12}}
p12-password: ${{secrets.CERTIFICATES_P12_PASSWORD}}
2024-09-18 22:00:46 -05:00
- name: '💿 Mount DMG and copy application'
run: |
VOLUME=$(yes | hdiutil attach ./build/*.dmg -nobrowse | grep "Volumes" | awk '{print $3}')
2024-09-18 22:00:46 -05:00
cp -a "$VOLUME/${{env.EXECUTABLE}}.app" "${{env.APPLICATION}}.app"
hdiutil detach "$VOLUME"
2024-05-05 01:55:11 -05:00
- name: '✍🏻 Sign Application'
run: codesign --force --deep --options runtime --sign "${{secrets.DEVELOPER_ID}}" "${{env.APPLICATION}}.app"
2024-09-18 22:00:46 -05:00
2024-05-05 01:55:11 -05:00
- name: '💽 Create nice DMG'
run: |
npm install --global create-dmg
2024-09-18 22:58:30 -05:00
rm LICENSE.md
2024-05-05 01:55:11 -05:00
create-dmg "${{env.APPLICATION}}.app" --dmg-title="${{env.APPLICATION}}"
2024-11-07 15:05:02 -05:00
mv "${{env.APPLICATION}} ${{env.VERSION}}.dmg" "${{env.EXECUTABLE}}-${{env.VERSION}}-macOS-aarch64.dmg"
2024-05-05 01:55:11 -05:00
- name: '📋 Notarize'
uses: alex-spataru/xcode-notarize@v2
with:
2024-11-07 15:05:02 -05:00
product-path: ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS-aarch64.dmg
2024-05-05 01:55:11 -05:00
appstore-connect-username: ${{secrets.NOTARIZATION_USERNAME}}
appstore-connect-teamid: ${{secrets.NOTARIZATION_TEAMID}}
appstore-connect-password: ${{secrets.NOTARIZATION_PASSWORD}}
- name: '📌 Staple'
uses: BoundfoxStudios/action-xcode-staple@v1
with:
2024-11-07 15:05:02 -05:00
product-path: ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS-aarch64.dmg
2024-05-05 01:55:11 -05:00
- name: '📤 Upload artifact: DMG'
uses: actions/upload-artifact@v4
with:
2024-11-07 15:05:02 -05:00
name: ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS-aarch64.dmg
path: ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS-aarch64.dmg
#
# macOS (Intel) build
#
build-mac-intel:
2024-11-18 14:30:12 -05:00
runs-on: macos-13
name: '🍎 macOS (Intel)'
steps:
- name: '🧰 Checkout'
uses: actions/checkout@v4
- name: '⚙️ Install Qt'
2024-10-09 10:37:12 -05:00
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION_MACOS}}
modules: ${{env.QT_MODULES}}
arch: clang_64
cache: 'true'
- name: '⚙️ Install CMake'
uses: lukka/get-cmake@latest
with:
useLocalCache: true
- name: '⚙️ Install Node'
uses: actions/setup-node@v4
with:
node-version: 20
- name: '🚧 Configure with CMake'
run: |
mkdir build
cd build
cmake ../ -DCMAKE_BUILD_TYPE=Release
- name: '🚧 Build application'
run: |
cd build
2024-10-13 01:21:33 -05:00
cmake --build . --config Release -j 16
- name: '📦 Package application'
run: |
cd build
cpack --verbose
- name: '🪪 Import Code Signing Certificate'
uses: apple-actions/import-codesign-certs@v2
with:
p12-file-base64: ${{secrets.CERTIFICATES_P12}}
p12-password: ${{secrets.CERTIFICATES_P12_PASSWORD}}
- name: '💿 Mount DMG and copy application'
run: |
VOLUME=$(yes | hdiutil attach ./build/*.dmg -nobrowse | grep "Volumes" | awk '{print $3}')
cp -a "$VOLUME/${{env.EXECUTABLE}}.app" "${{env.APPLICATION}}.app"
hdiutil detach "$VOLUME"
- name: '✍🏻 Sign Application'
run: codesign --force --deep --options runtime --sign "${{secrets.DEVELOPER_ID}}" "${{env.APPLICATION}}.app"
- name: '💽 Create nice DMG'
run: |
npm install --global create-dmg
rm LICENSE.md
create-dmg "${{env.APPLICATION}}.app" --dmg-title="${{env.APPLICATION}}"
2024-11-06 15:59:36 -05:00
mv "${{env.APPLICATION}} ${{env.VERSION}}.dmg" "${{env.EXECUTABLE}}-${{env.VERSION}}-macOS-x86_64.dmg"
- name: '📋 Notarize'
uses: alex-spataru/xcode-notarize@v2
with:
2024-11-06 15:59:36 -05:00
product-path: ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS-x86_64.dmg
appstore-connect-username: ${{secrets.NOTARIZATION_USERNAME}}
appstore-connect-teamid: ${{secrets.NOTARIZATION_TEAMID}}
appstore-connect-password: ${{secrets.NOTARIZATION_PASSWORD}}
- name: '📌 Staple'
uses: BoundfoxStudios/action-xcode-staple@v1
with:
2024-11-06 15:59:36 -05:00
product-path: ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS-x86_64.dmg
- name: '📤 Upload artifact: DMG'
uses: actions/upload-artifact@v4
with:
2024-11-06 15:59:36 -05:00
name: ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS-x86_64.dmg
path: ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS-x86_64.dmg
2021-02-04 06:42:14 +01:00
#
# Windows build
#
build-windows:
2024-04-01 02:42:21 -05:00
runs-on: windows-latest
name: '🧊 Windows'
steps:
2024-09-18 22:00:46 -05:00
- run: git config --global core.autocrlf input
2021-02-04 06:42:14 +01:00
- name: '🧰 Checkout'
2024-04-01 02:42:21 -05:00
uses: actions/checkout@v4
2021-02-04 06:42:14 +01:00
- name: '⚙️ Install Qt'
2024-10-09 10:37:12 -05:00
uses: jurplel/install-qt-action@v4
2021-02-04 06:42:14 +01:00
with:
2024-09-18 22:00:46 -05:00
version: ${{env.QT_VERSION_WINDOWS}}
2023-01-22 07:44:34 -06:00
modules: ${{env.QT_MODULES}}
2024-09-18 22:00:46 -05:00
cache: 'true'
2024-11-18 19:43:50 -05:00
arch: win64_llvm_mingw
2024-09-18 22:00:46 -05:00
- name: '⚙️ Install CMake'
uses: lukka/get-cmake@latest
with:
2024-09-18 22:00:46 -05:00
useLocalCache: true
2023-01-22 07:44:34 -06:00
2024-09-18 22:00:46 -05:00
- name: '🚧 Configure with CMake'
2022-05-26 14:38:51 -05:00
run: |
2024-09-18 22:00:46 -05:00
mkdir build
cd build
2024-11-18 19:43:50 -05:00
cmake ../ -DCMAKE_BUILD_TYPE=Release
#cmake ../ -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -DCMAKE_BUILD_TYPE=Release
2024-09-18 22:00:46 -05:00
- name: '🚧 Build application'
2021-02-04 06:42:14 +01:00
run: |
2024-09-18 22:00:46 -05:00
cd build
2024-10-13 01:21:33 -05:00
cmake --build . --config Release -j 16
2021-02-04 06:42:14 +01:00
2024-09-18 22:00:46 -05:00
- name: '📦 Package application'
run: |
cd build
cpack --verbose
2024-11-06 15:59:36 -05:00
mv *.exe ${{env.EXECUTABLE}}-${{env.VERSION}}-Windows-x86_64.exe
mv ${{env.EXECUTABLE}}-${{env.VERSION}}-Windows-x86_64.exe ../
2024-09-18 22:00:46 -05:00
2021-02-04 06:42:14 +01:00
- name: '📤 Upload artifact: NSIS installer'
uses: actions/upload-artifact@v4
2021-02-04 06:42:14 +01:00
with:
2024-11-06 15:59:36 -05:00
name: ${{env.EXECUTABLE}}-${{env.VERSION}}-Windows-x86_64.exe
path: ${{env.EXECUTABLE}}-${{env.VERSION}}-Windows-x86_64.exe
2022-09-11 17:49:59 +08:00
# Upload continuous build
2021-10-20 06:00:56 -05:00
upload:
name: '🗂 Create release and upload artifacts'
needs:
2024-11-07 15:05:02 -05:00
- build-mac-aarch64
- build-mac-intel
2021-10-20 06:00:56 -05:00
- build-windows
2024-09-18 22:00:46 -05:00
- build-linux
2024-05-05 00:55:33 -05:00
runs-on: ubuntu-latest
2021-10-20 06:00:56 -05:00
steps:
- name: '📥 Download artifacts'
2024-05-05 00:55:33 -05:00
uses: actions/download-artifact@v4
2021-10-20 06:19:15 -05:00
- name: '🗂 Inspect directory after downloading artifacts'
run: ls -alFR
2021-10-20 06:00:56 -05:00
- name: '🚀 Create release and upload artifacts'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
2024-05-05 01:04:47 -05:00
sudo apt-get update
sudo apt-get install libfuse2
2021-10-20 06:00:56 -05:00
wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage
chmod +x pyuploadtool-x86_64.AppImage
2024-11-06 15:59:36 -05:00
./pyuploadtool-x86_64.AppImage **/${{env.EXECUTABLE}}-${{env.VERSION}}-Linux-x86_64.deb
./pyuploadtool-x86_64.AppImage **/${{env.EXECUTABLE}}-${{env.VERSION}}-Linux-x86_64.rpm
./pyuploadtool-x86_64.AppImage **/${{env.EXECUTABLE}}-${{env.VERSION}}-Linux-x86_64.AppImage
2024-11-07 15:05:02 -05:00
./pyuploadtool-x86_64.AppImage **/${{env.EXECUTABLE}}-${{env.VERSION}}-macOS-aarch64.dmg
2024-11-06 15:59:36 -05:00
./pyuploadtool-x86_64.AppImage **/${{env.EXECUTABLE}}-${{env.VERSION}}-macOS-x86_64.dmg
./pyuploadtool-x86_64.AppImage **/${{env.EXECUTABLE}}-${{env.VERSION}}-Windows-x86_64.exe
2024-09-18 22:00:46 -05:00