From 53f682d6838a645ee6846b61a9643cdaa10def40 Mon Sep 17 00:00:00 2001 From: yshalsager Date: Wed, 17 Aug 2022 19:41:39 +0200 Subject: [PATCH] chore(ci): Switch to release action, add linux back Signed-off-by: yshalsager --- .github/workflows/{ci.yml => release.yml} | 106 ++++++++++++--------- poetry.lock | 110 +++++++++++++++++++++- pyproject.toml | 1 + requirements.txt | 17 ++++ 4 files changed, 187 insertions(+), 47 deletions(-) rename .github/workflows/{ci.yml => release.yml} (58%) create mode 100644 requirements.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/release.yml similarity index 58% rename from .github/workflows/ci.yml rename to .github/workflows/release.yml index 22accd7..243810b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/release.yml @@ -1,21 +1,15 @@ name: Package Application with cx_Freeze on: - push: - branches: [ master, dev ] - tags: [ v* ] - pull_request: - branches: [ master, dev ] -# workflow_dispatch: -# inputs: -# version-win: -# description: "Version(semver)" -# required: true -# default: "X.X" + workflow_dispatch: + inputs: + version: + description: "Version (semantic)" + required: true + default: "X.X" jobs: build-windows: - if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' && ${{ !contains(github.event.head_commit.message, '(deps') }} runs-on: windows-latest strategy: matrix: @@ -38,14 +32,14 @@ jobs: Invoke-WebRequest https://github.com/GyanD/codexffmpeg/releases/download/5.1/ffmpeg-5.1-essentials_build.zip -O ffmpeg.zip tar.exe -xf ffmpeg.zip move ffmpeg-5.1-essentials_build/bin/ffmpeg.exe ffmpeg.exe + move ffmpeg-5.1-essentials_build/bin/ffprobe.exe ffprobe.exe - run: python setup.py build -b dist - - run: tar.exe -acf dist.zip dist + - run: tar.exe -acf TranscribeArabic-${{ runner.os }}-${{ matrix.architecture }}-portable.zip dist - uses: actions/upload-artifact@v3 with: - name: TranscribeArabic-${{ runner.os }}-${{ matrix.architecture }}-portable.zip - path: dist.zip + name: TranscribeArabic-${{ runner.os }}-${{ matrix.architecture }}-portable + path: TranscribeArabic-${{ runner.os }}-${{ matrix.architecture }}-portable.zip build-windows-msi: - if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' && ${{ !contains(github.event.head_commit.message, '(deps') }} runs-on: windows-latest strategy: matrix: @@ -73,38 +67,14 @@ jobs: Invoke-WebRequest https://github.com/GyanD/codexffmpeg/releases/download/5.1/ffmpeg-5.1-essentials_build.zip -O ffmpeg.zip tar.exe -xf ffmpeg.zip move ffmpeg-5.1-essentials_build/bin/ffmpeg.exe ffmpeg.exe + move ffmpeg-5.1-essentials_build/bin/ffprobe.exe ffprobe.exe - run: python setup.py build bdist_msi +# - run: mv 'dist/*.msi' TranscribeArabic-${{ runner.os }}-${{ matrix.architecture }}.msi - uses: actions/upload-artifact@v3 with: name: TranscribeArabic-${{ runner.os }}-${{ matrix.architecture }}.msi path: 'dist/*.msi' -# build-linux: -# if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' && ${{ !contains(github.event.head_commit.message, '(deps') }} -# runs-on: ubuntu-latest -# strategy: -# matrix: -# architecture: [ 'x64', 'x86' ] -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-python@v4 -# with: -# python-version: '3.10' -# architecture: 'x64' -# cache: 'pip' -# cache-dependency-path: 'poetry.lock' -# - name: Install requirements -# run: | -# python -m pip install --upgrade pip setuptools wheel -# pip install . -# pip install cx-Freeze -# - run: python setup.py build -b linux -# - run: tar -czvf TranscribeArabic.tar.gz linux -# - uses: actions/upload-artifact@v3 -# with: -# name: TranscribeArabic-${{ runner.os }}-${{ matrix.architecture }}.zip -# path: TranscribeArabic.tar.gz build-macos-dmg: - if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' && ${{ !contains(github.event.head_commit.message, '(deps') }} runs-on: macos-latest steps: - uses: actions/checkout@v3 @@ -121,12 +91,12 @@ jobs: pip install cx-Freeze - name: Run cx_Freeze run: python setup.py bdist_dmg + - run: mv 'build/Install Transcribe Arabic.dmg' TranscribeArabic-macOS.dmg - uses: actions/upload-artifact@v3 with: name: TranscribeArabic-macOS.dmg - path: build/Install Transcribe Arabic.dmg + path: TranscribeArabic-macOS.dmg build-macos-app: - if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' && ${{ !contains(github.event.head_commit.message, '(deps') }} runs-on: macos-latest steps: - uses: actions/checkout@v3 @@ -143,7 +113,51 @@ jobs: pip install cx-Freeze - name: Run cx_Freeze run: python setup.py bdist_mac + - run: mv build/TranscribeArabic.app TranscribeArabic-macOS.app + - run: zip -r9 TranscribeArabic-macOS-app.zip TranscribeArabic-macOS.app/* - uses: actions/upload-artifact@v3 with: - name: TranscribeArabic-macOS.app - path: build/TranscribeArabic.app + name: TranscribeArabic-macOS-app.zip + path: TranscribeArabic-macOS-app.zip + build-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Package CLI Application for Linux + uses: yshalsager/pyinstaller-action-linux@main + with: + path: . + spec: wit_transcriber.spec + requirements: requirements.txt + - uses: actions/upload-artifact@v3 + with: + name: TranscribeArabic-Linux-CLI + path: dist/linux/wit_transcriber + + - name: Package GUI Application for Linux + uses: yshalsager/pyinstaller-action-linux@tkinter + with: + path: . + spec: wit_transcriber_gui.spec + requirements: requirements.txt + tkinter: true + - uses: actions/upload-artifact@v3 + with: + name: TranscribeArabic-Linux-GUI + path: dist/linux/wit_transcriber_gui + release: + runs-on: ubuntu-latest + needs: [build-windows, build-windows-msi, build-macos-dmg, build-macos-app, build-linux] + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + - name: Display structure of downloaded files + run: ls -R + - name: Release + uses: ncipollo/release-action@v1.10.0 + with: + allowUpdates: true + commit: 'master' + tag: ${{ github.event.inputs.version }} + name: ${{ github.event.inputs.version }} + artifacts: '*/*.msi, */*.zip, */wit_transcriber, */wit_transcriber_gui, */*.dmg' diff --git a/poetry.lock b/poetry.lock index 58ca3c9..0a732c8 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,3 +1,11 @@ +[[package]] +name = "altgraph" +version = "0.17.2" +description = "Python graph (network) package" +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "anyio" version = "3.6.1" @@ -134,6 +142,14 @@ mccabe = ">=0.7.0,<0.8.0" pycodestyle = ">=2.9.0,<2.10.0" pyflakes = ">=2.5.0,<2.6.0" +[[package]] +name = "future" +version = "0.18.2" +description = "Clean single-source support for Python 3 and 2" +category = "dev" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" + [[package]] name = "h11" version = "0.12.0" @@ -221,6 +237,17 @@ category = "dev" optional = false python-versions = ">=3.6" +[[package]] +name = "macholib" +version = "1.16" +description = "Mach-O header analysis and editing" +category = "dev" +optional = false +python-versions = "*" + +[package.dependencies] +altgraph = ">=0.15" + [[package]] name = "mccabe" version = "0.7.0" @@ -293,6 +320,17 @@ category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" +[[package]] +name = "pefile" +version = "2022.5.30" +description = "Python PE parsing module" +category = "dev" +optional = false +python-versions = ">=3.6.0" + +[package.dependencies] +future = "*" + [[package]] name = "pillow" version = "9.2.0" @@ -357,6 +395,33 @@ category = "dev" optional = false python-versions = ">=3.6" +[[package]] +name = "pyinstaller" +version = "5.3" +description = "PyInstaller bundles a Python application and all its dependencies into a single package." +category = "dev" +optional = false +python-versions = "<3.11,>=3.7" + +[package.dependencies] +altgraph = "*" +macholib = {version = ">=1.8", markers = "sys_platform == \"darwin\""} +pefile = {version = ">=2022.5.30", markers = "sys_platform == \"win32\""} +pyinstaller-hooks-contrib = ">=2021.4" +pywin32-ctypes = {version = ">=0.2.0", markers = "sys_platform == \"win32\""} + +[package.extras] +encryption = ["tinyaes (>=1.0.0)"] +hook_testing = ["pytest (>=2.7.3)", "execnet (>=1.5.0)", "psutil"] + +[[package]] +name = "pyinstaller-hooks-contrib" +version = "2022.8" +description = "Community maintained hooks for PyInstaller" +category = "dev" +optional = false +python-versions = ">=3.7" + [[package]] name = "pyparsing" version = "3.0.9" @@ -379,6 +444,14 @@ python-versions = "*" [package.dependencies] six = "*" +[[package]] +name = "pywin32-ctypes" +version = "0.2.0" +description = "" +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "pyyaml" version = "6.0" @@ -472,9 +545,13 @@ testing = ["coverage (>=6.2)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7 [metadata] lock-version = "1.1" python-versions = ">=3.10,<3.11" -content-hash = "afd5277048ecace9474e2bbfa1824232f761d80c94e38aeef6cfdac5ca3c776f" +content-hash = "dd26f367f292b376af52e8756cca1891f79a16d03df089e9052b645f4d3c64ee" [metadata.files] +altgraph = [ + {file = "altgraph-0.17.2-py2.py3-none-any.whl", hash = "sha256:743628f2ac6a7c26f5d9223c91ed8ecbba535f506f4b6f558885a8a56a105857"}, + {file = "altgraph-0.17.2.tar.gz", hash = "sha256:ebf2269361b47d97b3b88e696439f6e4cbc607c17c51feb1754f90fb79839158"}, +] anyio = [ {file = "anyio-3.6.1-py3-none-any.whl", hash = "sha256:cb29b9c70620506a9a8f87a309591713446953302d7d995344d0d7c6c0c9a7be"}, {file = "anyio-3.6.1.tar.gz", hash = "sha256:413adf95f93886e442aea925f3ee43baa5a765a64a0f52c6081894f9992fdd0b"}, @@ -563,6 +640,9 @@ flake8 = [ {file = "flake8-5.0.4-py2.py3-none-any.whl", hash = "sha256:7a1cf6b73744f5806ab95e526f6f0d8c01c66d7bbe349562d22dfca20610b248"}, {file = "flake8-5.0.4.tar.gz", hash = "sha256:6fbe320aad8d6b95cec8b8e47bc933004678dc63095be98528b7bdd2a9f510db"}, ] +future = [ + {file = "future-0.18.2.tar.gz", hash = "sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d"}, +] h11 = [ {file = "h11-0.12.0-py3-none-any.whl", hash = "sha256:36a3cb8c0a032f56e2da7084577878a035d3b61d104230d4bd49c0c6b555a9c6"}, {file = "h11-0.12.0.tar.gz", hash = "sha256:47222cb6067e4a307d535814917cd98fd0a57b6788ce715755fa2b6c28b56042"}, @@ -613,6 +693,10 @@ lief = [ {file = "lief-0.12.1-cp39-cp39-win_amd64.whl", hash = "sha256:960a2da9f28c8d5dba753bb9ab77e26b3c6ff9b9658918be95650ceb8ee91e68"}, {file = "lief-0.12.1.zip", hash = "sha256:4ff4ccfae2e1ee4ccba2b5556027dbb56282b8a973c5835c5b597e8b7b664416"}, ] +macholib = [ + {file = "macholib-1.16-py2.py3-none-any.whl", hash = "sha256:5a0742b587e6e57bfade1ab90651d4877185bf66fd4a176a488116de36878229"}, + {file = "macholib-1.16.tar.gz", hash = "sha256:001bf281279b986a66d7821790d734e61150d52f40c080899df8fefae056e9f7"}, +] mccabe = [ {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, @@ -666,6 +750,9 @@ pathspec = [ {file = "pathspec-0.9.0-py2.py3-none-any.whl", hash = "sha256:7d15c4ddb0b5c802d161efc417ec1a2558ea2653c2e8ad9c19098201dc1c993a"}, {file = "pathspec-0.9.0.tar.gz", hash = "sha256:e564499435a2673d586f6b2130bb5b95f04a3ba06f81b8f895b651a3c76aabb1"}, ] +pefile = [ + {file = "pefile-2022.5.30.tar.gz", hash = "sha256:a5488a3dd1fd021ce33f969780b88fe0f7eebb76eb20996d7318f307612a045b"}, +] pillow = [ {file = "Pillow-9.2.0-cp310-cp310-macosx_10_10_x86_64.whl", hash = "sha256:a9c9bc489f8ab30906d7a85afac4b4944a572a7432e00698a7239f44a44e6efb"}, {file = "Pillow-9.2.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:510cef4a3f401c246cfd8227b300828715dd055463cdca6176c2e4036df8bd4f"}, @@ -746,6 +833,23 @@ pyflakes = [ {file = "pyflakes-2.5.0-py2.py3-none-any.whl", hash = "sha256:4579f67d887f804e67edb544428f264b7b24f435b263c4614f384135cea553d2"}, {file = "pyflakes-2.5.0.tar.gz", hash = "sha256:491feb020dca48ccc562a8c0cbe8df07ee13078df59813b83959cbdada312ea3"}, ] +pyinstaller = [ + {file = "pyinstaller-5.3-py3-none-macosx_10_13_universal2.whl", hash = "sha256:7591a9e1e2a481f99eb99036d6786e20717bc10f8f0a8ef519958cb3172fac7a"}, + {file = "pyinstaller-5.3-py3-none-manylinux2014_aarch64.whl", hash = "sha256:d4123992556951ed24e11cf2eec9a4e18e94ee8bd63ca49d9b7fc37387097eb9"}, + {file = "pyinstaller-5.3-py3-none-manylinux2014_i686.whl", hash = "sha256:066b83a0eae89ad418749e9e29429c152f1ff096230df11a093bbded8344ade0"}, + {file = "pyinstaller-5.3-py3-none-manylinux2014_ppc64le.whl", hash = "sha256:4c658a762cbbee5c5997c364578804d4c1e91d688de8ed018710c2705bf1474b"}, + {file = "pyinstaller-5.3-py3-none-manylinux2014_s390x.whl", hash = "sha256:a0e7a80fe04204add3f743101958a3cf62b79e7ccda838388784b1a35bb5b27f"}, + {file = "pyinstaller-5.3-py3-none-manylinux2014_x86_64.whl", hash = "sha256:aa9d1b8639d2402438c179ae1c8acfd41b65366c803a5a6484a5bb7586e88647"}, + {file = "pyinstaller-5.3-py3-none-musllinux_1_1_aarch64.whl", hash = "sha256:794e8e143ae73d1acdd2cbc52f02dd34cdfbd954ede34c7067ce68a268d8b7c2"}, + {file = "pyinstaller-5.3-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:9efbad718fe29d425336f289871c67bfc6a1876013037fee2ef1f7613fd675a2"}, + {file = "pyinstaller-5.3-py3-none-win32.whl", hash = "sha256:cae43e01e04f37185d23202aba8cf2837fa24ec3d0aa5ebc42e26f404e6eba95"}, + {file = "pyinstaller-5.3-py3-none-win_amd64.whl", hash = "sha256:b38505b445cdd64279f04650e0ddfe5ac6cef61996b14f06e3c99da8aac3cfbe"}, + {file = "pyinstaller-5.3.tar.gz", hash = "sha256:de71d4669806e4d54b23b477cc077e2e8fe9c4d57e79ed32d22b7585137fd7b7"}, +] +pyinstaller-hooks-contrib = [ + {file = "pyinstaller-hooks-contrib-2022.8.tar.gz", hash = "sha256:c4210fc50282c9c6a918e485e0bfae9405592390508e3be9fde19acc2213da56"}, + {file = "pyinstaller_hooks_contrib-2022.8-py2.py3-none-any.whl", hash = "sha256:e46f099934dd4577fb1ddcf37a99fa04027c92f8f5291c8802f326345988d001"}, +] pyparsing = [ {file = "pyparsing-3.0.9-py3-none-any.whl", hash = "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc"}, {file = "pyparsing-3.0.9.tar.gz", hash = "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb"}, @@ -754,6 +858,10 @@ python-bidi = [ {file = "python-bidi-0.4.2.tar.gz", hash = "sha256:5347f71e82b3e9976dc657f09ded2bfe39ba8d6777ca81a5b2c56c30121c496e"}, {file = "python_bidi-0.4.2-py2.py3-none-any.whl", hash = "sha256:50eef6f6a0bbdd685f9e8c207f3c9050f5b578d0a46e37c76a9c4baea2cc2e13"}, ] +pywin32-ctypes = [ + {file = "pywin32-ctypes-0.2.0.tar.gz", hash = "sha256:24ffc3b341d457d48e8922352130cf2644024a4ff09762a2261fd34c36ee5942"}, + {file = "pywin32_ctypes-0.2.0-py2.py3-none-any.whl", hash = "sha256:9dc2d991b3479cc2df15930958b674a48a227d5361d413827a4cfd0b5876fc98"}, +] pyyaml = [ {file = "PyYAML-6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53"}, {file = "PyYAML-6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c"}, diff --git a/pyproject.toml b/pyproject.toml index 26e687b..2b298bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,7 @@ isort = "^5.10.1" mypy = "^0.971" flake8 = "^5.0.4" cx-Freeze = "^6.11.1" +pyinstaller = "^5.3" [build-system] requires = ["poetry-core>=1.0.0"] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..ec33aad --- /dev/null +++ b/requirements.txt @@ -0,0 +1,17 @@ +anyio==3.6.1; python_full_version >= "3.6.2" and python_version >= "3.7" +awesometkinter==2021.11.8; python_version >= "3.6" +certifi==2022.6.15; python_version >= "3.7" +click==8.1.3; python_version >= "3.7" +colorama==0.4.5; python_version >= "3.7" and python_full_version < "3.0.0" and platform_system == "Windows" or platform_system == "Windows" and python_version >= "3.7" and python_full_version >= "3.5.0" +h11==0.12.0; python_version >= "3.7" +httpcore==0.15.0; python_version >= "3.7" +httpx==0.23.0; python_version >= "3.7" +idna==3.3; python_version >= "3.7" and python_full_version >= "3.6.2" +pillow==9.2.0; python_version >= "3.7" +pydub==0.25.1 +python-bidi==0.4.2; python_version >= "3.6" +ratelimiter==1.2.0.post0 +rfc3986==1.5.0; python_version >= "3.7" +six==1.16.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.6" +sniffio==1.2.0; python_full_version >= "3.6.2" and python_version >= "3.7" +toml==0.10.2; (python_version >= "2.6" and python_full_version < "3.0.0") or (python_full_version >= "3.3.0")