Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pyatv, dependencies and build process #10

Merged
merged 2 commits into from
Feb 17, 2024
Merged
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
55 changes: 38 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,58 @@ on:
env:
INTG_NAME: appletv
HASH_FILENAME: uc-intg-appletv.hash

# Python version to use in the builder image. See https://hub.docker.com/r/unfoldedcircle/r2-pyinstaller for possible versions.
PYTHON_VER: 3.11.6-0.2.0

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

# We need the integration library, this is temporary until we decide to publish it to pypi
with:
# History of 200 should be more than enough to calculate commit count since last release tag.
fetch-depth: 200

- name: Fetch all tags to determine version
run: |
git fetch origin +refs/tags/*:refs/tags/*
echo "VERSION=$(git describe --match "v[0-9]*" --tags HEAD --always)" >> $GITHUB_ENV

# We need the integration library, this is temporary until we decide to publish it to pypi
- name: Clone integrations library
shell: bash
run: |
git clone https://martonborzak:${{ secrets.PAT }}@github.com/aitatoi/integration-python-library.git
git clone https://martonborzak:${{ secrets.PAT }}@github.com/aitatoi/integration-python-library.git --branch v0.0.10
ls -lah

- name: Prepare
- name: Verify driver.json version for release build
if: contains(github.ref, 'tags/v')
run: |
DRIVER_VERSION="v$(jq .version -r driver.json)"
if [ "${{ env.VERSION }}" != "$DRIVER_VERSION" ]; then
echo "Version in driver.json ($DRIVER_VERSION) doesn't match git version tag (${{ env.VERSION }})!"
exit 1
fi

- name: Build
run: |
sudo apt-get update && sudo apt-get install -y qemu binfmt-support qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --name builder --platform=aarch64 -v ${GITHUB_WORKSPACE}:/io -d ubuntu:focal tail -f /dev/null

docker exec builder bash -c "apt-get update && apt-get install -y python3-pip"
docker exec builder bash -c "cd /io/integration-python-library && python3 setup.py bdist_wheel && pip3 install -I dist/ucapi-0.0.10-py3-none-any.whl"
docker exec builder bash -c "pip3 install pyinstaller -r /io/requirements.txt"
docker exec builder bash -c "cd /io && pyinstaller --clean --onefile --name intg-appletv driver.py"

- name: Fetch all tags to determine version
run: |
git fetch origin +refs/tags/*:refs/tags/*
echo "VERSION=$(git describe --match "v[0-9]*" --tags HEAD --always)" >> $GITHUB_ENV

echo "Starting pyinstaller build"
docker run --rm --name builder \
--platform=aarch64 \
--user=$(id -u):$(id -g) \
-v ${GITHUB_WORKSPACE}:/workspace \
docker.io/unfoldedcircle/r2-pyinstaller:${PYTHON_VER} \
bash -c \
"cd /workspace/integration-python-library && \
python setup.py bdist_wheel && \
pip install -I dist/ucapi-0.0.10-py3-none-any.whl && \
cd /workspace && \
python -m pip install -r requirements.txt && \
pyinstaller --clean --onefile --name intg-appletv --collect-all zeroconf driver.py"

- name: Add version
run: |
mkdir -p artifacts
Expand Down
103 changes: 102 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,106 @@
credentials.json
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
.pylint.d/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# Local development settings
.settings/
.project
.pydevproject
.pypirc
.pytest_cache

# Visual Studio Code
.vscode/

.DS_Store

config.json
env
licenses.json
Expand Down
Binary file removed __pycache__/tv.cpython-311.pyc
Binary file not shown.
33 changes: 4 additions & 29 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,4 @@
aiohttp==3.8.4
aiosignal==1.3.1
async-timeout==4.0.2
attrs==23.1.0
bitarray==2.7.3
certifi==2022.12.7
cffi==1.15.1
chacha20poly1305-reuseable==0.2.5
charset-normalizer==3.1.0
cryptography==40.0.2
frozenlist==1.3.3
idna==3.4
ifaddr==0.2.0
mediafile==0.11.0
miniaudio==1.56
multidict==6.0.4
mutagen==1.46.0
protobuf==4.22.3
pyatv==0.14.1
pycparser==2.21
pyee==9.0.4
requests==2.29.0
six==1.16.0
srptools==1.0.1
typing_extensions==4.5.0
urllib3==1.26.15
websockets==11.0.2
yarl==1.9.2
zeroconf>=0.72.0
pyatv==0.14.5
pyee>=9.0
websockets>=11.0
zeroconf==0.131.0
Loading