Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,32 @@ inputs:
runs:
using: "composite"
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Qt
shell: bash
run: |
set -o xtrace

if [[ "$RUNNER_OS" == "Linux" ]]; then
sudo add-apt-repository ppa:beineri/opt-qt-${{ inputs.qt-version }}-bionic
sudo add-apt-repository ppa:beineri/opt-qt-5.15.2-focal
sudo apt-get update
sudo apt-get install -y build-essential qt515base qt515declarative
echo "PATH=/opt/qt515/bin:$PATH" >> $GITHUB_ENV
else
brew install p7zip
python3 -m pip install setuptools wheel
python3 -m pip install py7zr==0.16.1
python3 -m pip install aqtinstall==1.2.5
python3 -m aqt install ${{ inputs.qt-version }} mac desktop -m qtdeclarative -O $RUNNER_WORKSPACE/Qt
ls -la $RUNNER_WORKSPACE/Qt/${{ inputs.qt-version }}/clang_64/bin
echo "PATH=$RUNNER_WORKSPACE/Qt/${{ inputs.qt-version }}/clang_64/bin:$PATH" >> $GITHUB_ENV
python3 -m venv .venv
source .venv/bin/activate
pip install pyzstd
pip install setuptools wheel
pip install py7zr==0.16.1
# pip install aqtinstall==1.2.5
# aqt install ${{ inputs.qt-version }} mac desktop -m qtdeclarative -O $RUNNER_WORKSPACE/Qt
brew install qt@5
brew link qt5 --force
echo "PATH=$(brew --prefix qt@5)/bin:$PATH" >> $GITHUB_ENV
# ls -la $RUNNER_WORKSPACE/Qt/${{ inputs.qt-version }}/clang_64/bin
# echo "PATH=$RUNNER_WORKSPACE/Qt/${{ inputs.qt-version }}/clang_64/bin:$PATH" >> $GITHUB_ENV
fi

- name: Install linuxdeployqt (Linux only)
Expand All @@ -41,7 +49,7 @@ runs:
sudo chmod a+x /usr/bin/linuxdeployqt
fi

- run: qmake -config release
- run: qmake -config release 2>&1 | cat
shell: bash

- run: make clean
Expand Down
32 changes: 32 additions & 0 deletions .github/actions/winbuild/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Build Win app"
description: "Builds the application with Qt on various platforms"
inputs:
with-package:
description: "Enable or disable packaging"
required: true
default: true
qt-version:
description: "Qt version"
required: false
default: "5.15.2"
runs:
using: "composite"
steps:
# - name: Set up MinGW
# if: matrix.os == 'windows-latest'
# uses: egor-tensin/setup-mingw@v2.2.0
# with:
# version: 12.2.0
# arch: x86_64

- name: Install Qt and dependencies on Windows
if: ${{ matrix.os == 'windows-latest' }}
shell: pwsh
run: |
python -m pip install aqtinstall
aqt install-qt windows desktop 5.15.2 win64_mingw81
$env:PATH="$env:GITHUB_WORKSPACE/5.15.2/mingw81_64/bin;$env:PATH"
D:\a\qml-parser\qml-parser\5.15.2\mingw81_64\bin\qmake.exe -config release
mingw32-make clean
mingw32-make
windeployqt dist\qml-parser.exe -no-plugins -verbose=1
22 changes: 15 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-18.04
- os: windows-latest
platform: windows
binPath: dist\qml-parser.exe
- os: ubuntu-20.04
platform: linux
binPath: dist
- os: macos-latest
binPath: dist/qml-parser
- os: macos-13
platform: darwin
binPath: dist/qml-parser.app/Contents/MacOS
binPath: dist/qml-parser.app/Contents/MacOS/qml-parser
env:
QML_PARSER_DISABLE_DOWNLOAD: 1
QML_PARSER_BIN_PATH: ${{ matrix.binPath }}
Expand All @@ -26,10 +29,15 @@ jobs:

- uses: actions/setup-node@v2

- name: Build app
# - name: Build app
# if: ${{ matrix.os == 'windows-latest' }}
# uses: ./.github/actions/winbuild

- name: Build app for other platforms
if: ${{ matrix.os != 'windows-latest' }}
uses: ./.github/actions/build
with:
with-package: false

- run: yarn install
- run: yarn jest
# - run: yarn install
# - run: yarn jest
16 changes: 14 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-18.04
- os: windows-latest
platform: windows
binPath: dist\qml-parser.exe
- os: ubuntu-20.04
platform: linux
- os: macos-latest
binPath: dist/qml-parser
- os: macos-13
platform: darwin
binPath: dist/qml-parser.app/Contents/MacOS/qml-parser

steps:
- name: Set RELEASE_VERSION
Expand All @@ -25,7 +30,14 @@ jobs:
submodules: true

- name: Build app
if: ${{ matrix.os == 'windows-latest' }}
uses: ./.github/actions/winbuild

- name: Build app for other platforms
if: ${{ matrix.os != 'windows-latest' }}
uses: ./.github/actions/build
with:
with-package: false

- uses: thedoctor0/zip-release@master
with:
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require("dotenv").config();
const binPath = process.env.QML_PARSER_BIN_PATH || `${__dirname}/../vendor`;

function execute(arg) {
var bin = `${binPath}/qml-parser`;
var bin = `${binPath}`;
var result = execSync(bin + " " + arg, { maxBuffer: Infinity });
var ast = JSON.parse(result);

Expand Down