Skip to content

Commit

Permalink
Merge pull request #195 from Quantomatic/cd
Browse files Browse the repository at this point in the history
Continuous deployment
  • Loading branch information
boldar99 authored Nov 24, 2023
2 parents 7fcfff3 + 3a5c33c commit 1048659
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 31 deletions.
41 changes: 31 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: deploy
name: Deploy and release

on:
push:
tags:
- '*'
- "v*.*.*"

env:
SRC_DIR: zxlive
Expand All @@ -12,7 +12,7 @@ jobs:
build_and_deploy:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
python-version: [ 3.11 ]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -21,12 +21,33 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install base package
run: pip install cx_freeze
- name: Deploy
cache: 'pip'
- name: Download Dependency Walker - Specific to Windows
# If this is not done, Nuitka crashes weirdly.
if: matrix.os == 'windows-latest'
run: |
python deploy.py build
- name: Publish
Invoke-WebRequest -Uri 'https://dependencywalker.com/depends22_x86.zip' -OutFile 'depends22_x86.zip'
Add-Type -AssemblyName System.IO.Compression.FileSystem ;
[System.IO.Compression.ZipFile]::ExtractToDirectory("depends22_x86.zip", "depends22_x86")
New-Item -ItemType Directory -Path C:\Users\runneradmin\AppData\Local\Nuitka\Nuitka\Cache\downloads\depends\x86_64\ -Force
Move-Item -Path depends22_x86\depends.exe -Destination C:\Users\runneradmin\AppData\Local\Nuitka\Nuitka\Cache\downloads\depends\x86_64\depends.exe
- name: Install dependencies
run:
pip install .
- name: Build ZXLive
run: pyside6-deploy -v -f -c pysidedeploy.spec --keep-deployment-files
- name: Rename files, fix deployment file location - Windows
if: matrix.os == 'windows-latest'
run: mv build/__main__.exe ./zxlive_app_windows.exe
- name: Rename files, fix deployment file location - Linux, MacOS
if: matrix.os != 'windows-latest'
run: |
ls build
echo "TODO: publish build/zxlive and the related files"
if [ "$RUNNER_OS" == "Linux" ]; then
mv build/__main__.bin ./zxlive_app_linux.bin
elif [ "$RUNNER_OS" == "macOS" ]; then
mv zxlive/deployment/__main__.app/Contents/MacOS/__main__ ./zxlive_app_macos.bin
fi
- name: Release
uses: softprops/action-gh-release@v1
with:
files: zxlive_app_*
7 changes: 0 additions & 7 deletions deploy.py

This file was deleted.

14 changes: 0 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ test = [
"pylint",
"pytest-qt",
]
deploy = ["cx_Freeze"]

[project.urls]
Homepage = "https://github.com/Quantomatic/zxlive"
Expand Down Expand Up @@ -79,16 +78,3 @@ disallow_untyped_defs = true
disable_error_code = [
"import",
]

[tool.distutils.build_exe]
excludes = [
"IPython",
"jupyter",
"pytest",
"mypy",
]
zip_include_packages = [
"encodings",
"zxlive",
"pyzx",
]
73 changes: 73 additions & 0 deletions pysidedeploy.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
[app]
# title of your application
title = ZXLive
# project directory. the general assumption is that project_dir is the parent directory
# of input_file
project_dir = ./zxlive/
# source file path
input_file = __main__.py
# directory where exec is stored
exec_directory = ./build/
# path to .pyproject project file
project_file =

[python]
# python path
python_path = python
# python packages to install
# ordered-set = increase compile time performance of nuitka packaging
# zstandard = provides final executable size optimization
packages = nuitka==1.8.*,ordered_set,zstandard
# buildozer = for deploying Android application
android_packages = buildozer==1.5.*,cython==0.29.*

[qt]
# comma separated path to qml files required
# normally all the qml files are added automatically
qml_files =
# excluded qml plugin binaries
excluded_qml_plugins =
# path to pyside wheel
wheel_pyside =
# path to shiboken wheel
wheel_shiboken =

[nuitka]
# (str) specify any extra nuitka arguments
# for arm macos add --macos-create-app-bundle
extra_args =
--noinclude-qt-translations
--nofollow-import-to=IPython
--nofollow-import-to=scipy
--nofollow-import-to=pytest
--nofollow-import-to=matplotlib
--nofollow-import-to=pandas
--nofollow-import-to=sympy
--nofollow-import-to=ipywidgets
--nofollow-import-to=tkinter
--deployment
--disable-console
--include-package-data=zxlive.icons
--macos-create-app-bundle

[buildozer]
# build mode
# possible options = [release, debug]
# release creates an aab, while debug creates an apk
mode = debug
# contrains path to pyside6 and shiboken6 recipe dir
recipe_dir =
# path to extra qt android jars to be loaded by the application
jars_dir =
# if empty uses default ndk path downloaded by buildozer
ndk_path =
# if empty uses default sdk path downloaded by buildozer
sdk_path =
# modules used. comma separated
modules =
# other libraries to be loaded. comma separated.
local_libs = plugins_platforms_qtforandroid
# architecture of deployed platform
# possible values = ["aarch64", "armv7a", "i686", "x86_64"]
arch =

0 comments on commit 1048659

Please sign in to comment.