Skip to content

Update UI components to follow styles #277

Update UI components to follow styles

Update UI components to follow styles #277

Workflow file for this run

name: CMake Build Matrix
on:
push:
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- name: "Windows Latest MSVC"
target_name: "FigmaQML"
os: windows-latest
cc: "cl"
cxx: "cl"
environment_script: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
generators: "Visual Studio 17 2022"
arch: "win64_msvc2019_64"
host: "windows"
libs: 'qt5compat qtshadertools'
# - name: "Windows Latest MinGW"
# artifact: "FigmaQML-Windows-MinGW.tar.xz"
# os: windows-latest
# cc: "gcc"
# cxx: "g++"
# generators: "Ninja"
# arch: 'win64_mingw'
# host: "windows"
# libs: 'qt5compat qtshadertools'
- name: "Ubuntu Latest GCC"
target_name: "FigmaQML.AppImage"
os: ubuntu-latest
cc: "gcc"
cxx: "g++"
generators: "Ninja"
arch: 'gcc_64'
host: "linux"
libs: 'qt5compat qtshadertools qtserialport'
- name: "macOS Latest Clang"
target_name: "FigmaQML.app"
os: macos-latest
cc: "clang"
cxx: "clang++"
generators: "Ninja"
arch: 'clang_64'
host: "mac"
libs: 'qt5compat qtshadertools'
- name: "Wasm"
target_name: "FigmaQML.wapp"
os: ubuntu-latest
cc: "em"
cxx: "em++"
generators: "Ninja"
arch: 'wasm_singlethread'
host: "linux"
libs: 'qt5compat qtshadertools'
steps:
- name: Install dependencies on windows
if: startsWith(matrix.config.os, 'windows')
run: |
choco install ninja cmake
ninja --version
cmake --version
- name: Install dependencies on ubuntu
if: startsWith(matrix.config.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install ninja-build cmake
ninja --version
cmake --version
gcc --version
sudo apt-get install doxygen
sudo apt-get install graphviz
sudo apt-get install aspell
- name: Install dependencies on macos
if: startsWith(matrix.config.os, 'macos')
run: |
brew install cmake ninja
ninja --version
cmake --version
- name: Install dependencies for wasm
if: startsWith(matrix.config.arch, 'wasm')
uses: mymindstorm/setup-emsdk@v14
with:
version: 3.1.37
- name: Install Qt desktop for wasm (unlike documentation says host is not installed)
if: startsWith(matrix.config.arch, 'wasm')
uses: jurplel/[email protected]
with:
aqtversion: '>=3.1.*'
version: '6.6.2'
host: linux
target: 'desktop'
arch: gcc_64
install-deps: 'true'
# WASM wont work unless host has shaders as well
modules: ${{ matrix.config.libs }}
tools: 'tools_ninja tools_cmake'
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
aqtversion: '>=3.1.7'
version: '6.6.2'
host: ${{ matrix.config.host }}
target: 'desktop'
arch: ${{ matrix.config.arch }}
install-deps: 'true'
modules: ${{ matrix.config.libs }}
tools: 'tools_ninja tools_cmake'
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Make WASM
if: startsWith(matrix.config.arch, 'wasm')
shell: bash
run: |
./wasm_build.sh "${{ github.workspace }}/../Qt/6.6.2"
exit $!
- name: Configure
if: '!startsWith(matrix.config.arch, ''wasm'')'
shell: cmake -P {0}
run: |
file(TO_CMAKE_PATH "${{ github.workspace }}" WS_PATH)
set(ENV{Qt6_DIR} "${WS_PATH}/../Qt/6.6.2/${{ matrix.config.arch }}")
set(ENV{CC} ${{ matrix.config.cc }})
set(ENV{CXX} ${{ matrix.config.cxx }})
message("CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}")
message("CMAKE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR}")
message("Qt6_DIR $ENV{Qt6_DIR}")
message("QT_ROOT_DIR $ENV{QT_ROOT_DIR}")
if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{ matrix.config.environment_script }}" STREQUAL "x")
execute_process(
COMMAND "${{ matrix.config.environment_script }}" && set
OUTPUT_FILE environment_script_output.txt
)
file(STRINGS environment_script_output.txt output_lines)
foreach(line IN LISTS output_lines)
if (line MATCHES "^([a-zA-Z0-9_-]+)=(.*)$")
set(ENV{${CMAKE_MATCH_1}} "${CMAKE_MATCH_2}")
endif()
endforeach()
endif()
execute_process(
COMMAND cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCI_ACTIONS=ON -G Ninja -DACTIONS=TRUE
RESULT_VARIABLE result
)
if (NOT result EQUAL 0)
message(FATAL_ERROR "Bad exit status ${result}")
endif()
- name: Build
# The jurplel/install-qt-action is broken in many ways - one way is that wasm's qt-cmake get corrupted, therefore I just dot wasm compilation this way
if: '!startsWith(matrix.config.arch, ''wasm'')'
shell: cmake -P {0}
run: |
set(ENV{NINJA_STATUS} "[%f/%t %o/sec] ")
if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{ matrix.config.environment_script }}" STREQUAL "x")
file(STRINGS environment_script_output.txt output_lines)
foreach(line IN LISTS output_lines)
if (line MATCHES "^([a-zA-Z0-9_-]+)=(.*)$")
set(ENV{${CMAKE_MATCH_1}} "${CMAKE_MATCH_2}")
endif()
endforeach()
endif()
execute_process(
COMMAND cmake --build build --config Release
RESULT_VARIABLE result
OUTPUT_VARIABLE build_out
ERROR_VARIABLE build_out
)
message("build out: ${build_out}")
if (NOT result EQUAL 0)
message(FATAL_ERROR "Bad exit status")
endif()
- name: QtDeploy (U)
if: startsWith(matrix.config.arch, 'gcc_64')
working-directory: build
run: |
pwd & ls -la
sudo apt-get install fuse libfuse2
wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage"
chmod +x linuxdeploy*.AppImage
export EXTRA_QT_PLUGINS=svg
./linuxdeploy-x86_64.AppImage --executable=./FigmaQML --appdir=${{ matrix.config.target_name }} --verbosity=3
- name: QtDeploy (A)
if: startsWith(matrix.config.arch, 'wasm')
working-directory: build
run: |
pwd & ls -la
mkdir ${{ matrix.config.target_name }}
cp favicon.ico ${{ matrix.config.target_name }}
cp FigmaQML.html ${{ matrix.config.target_name }}
cp *.js ${{ matrix.config.target_name }}
cp qtlogo.svg ${{ matrix.config.target_name }}
cp *.wasm ${{ matrix.config.target_name }}
ls -l ${{ matrix.config.target_name }}
- name: QtDeploy (M)
if: startsWith(matrix.config.os, 'macos')
working-directory: build
run: |
$Qt6_DIR/bin/macdeployqt ${{ matrix.config.target_name }} -qmldir=../qml
- name: QtDeploy (W)
if: startsWith(matrix.config.os, 'windows')
working-directory: build
shell: bash
run: |
mkdir ${{ matrix.config.target_name }}
cp FigmaQML.exe ${{ matrix.config.target_name }}/
$Qt6_DIR/bin/windeployqt.exe --qmldir ../qml --compiler-runtime "${{ matrix.config.target_name }}/FigmaQML.exe"
cp ../OpenSSL_win/*.dll ${{ matrix.config.target_name }}/
- name: Set env
shell: bash
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Upload
uses: actions/upload-artifact@v4
with:
path: ./build/${{ matrix.config.target_name }}
name: "${{ matrix.config.target_name }}-${{ matrix.config.arch }}-${{ env.RELEASE_VERSION }}"
#- name: Deploy docs
# if: startsWith(matrix.config.arch, 'gcc_64')
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./build/html
# destination_dir: docs
- name: Upload Docs
if: startsWith(matrix.config.arch, 'gcc_64')
uses: actions/upload-artifact@v4
with:
path: ./build/html
name: "docs-${{ matrix.config.arch }}-${{ env.RELEASE_VERSION }}"
release:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ${{ matrix.config.os }}
needs: build
strategy:
fail-fast: false
matrix:
config:
- name: "Windows Latest MSVC"
target_name: "FigmaQML"
os: windows-latest
arch: "win64_msvc2019_64"
- name: "Ubuntu Latest GCC"
target_name: "FigmaQML.AppImage"
os: ubuntu-latest
arch: 'gcc_64'
- name: "macOS Latest Clang"
target_name: "FigmaQML.app"
os: macos-latest
arch: 'clang_64'
- name: "Wasm"
target_name: "FigmaQML.wapp"
os: ubuntu-latest
arch: 'wasm_singlethread'
steps:
- name: Set env
shell: bash
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Download a Build Artifact
uses: actions/download-artifact@v4
with:
name: "${{ matrix.config.target_name }}-${{ matrix.config.arch }}-${{ env.RELEASE_VERSION }}"
- name: Tar
shell: bash
run: |
BALL="${{ matrix.config.target_name }}-${{ matrix.config.arch }}-${{ env.RELEASE_VERSION }}.gz"
tar -czvf $BALL --exclude=$BALL *
- name: Create Release
uses: ncipollo/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: "*-${{ env.RELEASE_VERSION }}.gz"
publish:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
#name: ${{ matrix.config.name }}
name: "Deploy"
runs-on: ubuntu-latest
needs: release
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
strategy:
fail-fast: false
# matrix:
# config:
# - name: "Ubuntu Latest GCC"
# target_name: docs
# arch: 'gcc_64'
# target_path: docs
# artifact_name: doxygen_pages
# - name: "Wasm"
# target_name: "FigmaQML.wapp"
# arch: 'wasm_singlethread'
# target_path: .
# artifact_name: wasm_app
steps:
- name: Set env
shell: bash
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
#- name: Download a Build Artifact
# uses: actions/download-artifact@v4
# with:
# name: "${{ matrix.config.target_name }}-${{ matrix.config.arch }}-${{ env.RELEASE_VERSION }}"
# path: ${{ matrix.config.target_path }}
- name: Download a Build Artifact
uses: actions/download-artifact@v4
with:
name: "docs-gcc_64-${{ env.RELEASE_VERSION }}"
path: docs
- name: Download a Build Artifact
uses: actions/download-artifact@v4
with:
name: "FigmaQML.wapp-wasm_singlethread-${{ env.RELEASE_VERSION }}"
- name: Prepare pages
shell: bash
run: |
ls -l
# the action seems to expect that content is extracted into _site folder (there is no docs)
mkdir -p _site
ls | grep -v _site | xargs mv -t _site
ls -lR
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4