diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 47b402a..fe18ad4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,8 +19,8 @@ jobs: python-version: ${{ matrix.python }} - name: Install tox and any other packages run: pip install tox - - name: Package with tox - run: tox -e package + - name: Package and Build + run: tox -e package,pex - name: Publish Python distribution to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: @@ -30,3 +30,24 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: gh release upload ${{ github.event.release.tag_name }} dist/*.tar.gz dist/*.whl build/*.pex + + windows-build: + runs-on: windows-latest + strategy: + matrix: + python: [3.9] + + steps: + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Install tox and any other packages + run: pip install tox + - name: Package and Build + run: tox -e nuitka-win + - name: Upload Release to GitHub + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release upload ${{ github.event.release.tag_name }} build/*.exe diff --git a/src/cli_entry.py b/src/cli_entry.py new file mode 100644 index 0000000..5ede175 --- /dev/null +++ b/src/cli_entry.py @@ -0,0 +1,4 @@ +from pyffstream import cli + +if __name__ == "__main__": + cli.main() diff --git a/tox.ini b/tox.ini index 476a2a3..c52d782 100644 --- a/tox.ini +++ b/tox.ini @@ -52,9 +52,38 @@ commands = [testenv:package] deps = flit - pex commands = flit build + +[testenv:pex] +deps = + pex +commands = + pex . "pex>=2.1.35" --console-script pyffstream --compile --output-file build/pyffstream.pex + +[testenv:nuitka-win] +deps = + nuitka + zstandard +commands = + nuitka3 \ + --assume-yes-for-downloads \ + --onefile \ + --mingw64 \ + --include-module=platformdirs.windows \ + --python-flag=-OO \ + -o build/pyffstream.exe \ + --windows-icon-from-ico=icon\icon.ico \ + --windows-product-version=0.0.0.1 \ + --windows-company-name=aphysically \ + --windows-file-description="A simple app to facilitate streaming via ffmpeg." \ + --output-dir=build \ + #--nofollow-import-to=setuptools \ + #--nofollow-import-to=pkg_resources \ + #--enable-plugin=anti-bloat \ + src\cli_entry.py +) +WINEPREFIX="$w_prefix" wine "${nuitka_flags[@]}" pex . "pex>=2.1.35" --console-script pyffstream --compile --output-file build/pyffstream.pex [flake8]