Skip to content

v3.0.0

v3.0.0 #146

Workflow file for this run

name: Pull Request build check
on:
pull_request:
paths:
- '**.py'
- 'requirements.txt'
- 'docs/*'
jobs:
build:
name: Build app & docs
runs-on: windows-latest
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10' ]
steps:
- name: Clone repo
uses: actions/checkout@v2
- name: Setup python (x86)
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x86
- name: Setup python (x64)
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install required libraries
run: |
py -${{ matrix.python-version }}-64 -m pip install -U pip
py -${{ matrix.python-version }}-64 -m pip install -U wheel pyinstaller setuptools tox
py -${{ matrix.python-version }}-64 -m pip install -U -r requirements.txt
py -${{ matrix.python-version }}-64 -m pip install -U -r requirements-optional.txt
py -${{ matrix.python-version }}-64 -m pip install -U -r requirements-docs.txt
py -${{ matrix.python-version }}-32 -m pip install -U pip
py -${{ matrix.python-version }}-32 -m pip install -U wheel pyinstaller setuptools tox
py -${{ matrix.python-version }}-32 -m pip install -U -r requirements.txt
py -${{ matrix.python-version }}-32 -m pip install -U -r requirements-optional.txt
py -${{ matrix.python-version }}-32 -m pip install -U -r requirements-docs.txt
- name: Test imports (x64)
run: |
# Setup for venv python x64
echo "Creating virtual environment"
py -${{ matrix.python-version }}-64 -m venv test_imports_x64
# Install mangadex-downloader
echo "Installing mangadex-downloader"
& ".\test_imports_x64\Scripts\python.exe" setup.py build
Move-Item -Path ".\build\lib\mangadex_downloader" -Destination ".\test_imports_x64"
# Preparing
$venvbindir_x64 = ".\Scripts"
$pythonvenv_x64 = "${venvbindir_x64}\python.exe"
$pipvenv_x64 = "${venvbindir_x64}\pip.exe"
Copy-Item -Path ".\requirements-optional.txt" -Destination ".\test_imports_x64"
Copy-Item -Path ".\requirements.txt" -Destination ".\test_imports_x64"
cd "test_imports_x64"
# Install required libraries in venv x64
echo "Installing required libraries"
& "${pipvenv_x64}" install -U wheel
& "${pipvenv_x64}" install -U -r requirements-optional.txt
& "${pipvenv_x64}" install -U -r requirements.txt
# Execute test imports
echo "Executing test imports"
& "${pythonvenv_x64}" -m mangadex_downloader --version
- name: Test imports (x86)
run: |
# Setup for venv python x86
echo "Creating virtual environment"
py -${{ matrix.python-version }}-32 -m venv test_imports_x86
# Install mangadex-downloader
echo "Installing mangadex-downloader"
& ".\test_imports_x86\Scripts\python.exe" setup.py build
Move-Item -Path ".\build\lib\mangadex_downloader" -Destination ".\test_imports_x86"
# Preparing
$venvbindir_x86 = ".\Scripts"
$pythonvenv_x86 = "${venvbindir_x86}\python.exe"
$pipvenv_x86 = "${venvbindir_x86}\pip.exe"
Copy-Item -Path ".\requirements-optional.txt" -Destination ".\test_imports_x86"
Copy-Item -Path ".\requirements.txt" -Destination ".\test_imports_x86"
cd "test_imports_x86"
# Install required libraries in venv x86
echo "Installing required libraries"
& "${pipvenv_x86}" install -U wheel
& "${pipvenv_x86}" install -U -r requirements-optional.txt
& "${pipvenv_x86}" install -U -r requirements.txt
# Execute test imports
echo "Executing test imports"
& "${pythonvenv_x86}" -m mangadex_downloader --version
- name: Get python version
run: |
$PythonVersion = (python --version)
echo "python_version=${PythonVersion}" | Out-File -FilePath $env:GITHUB_ENV -Append
# Build mangadex-downloader with PyInstaller
# only allow python 3.10
- name: Compile script
if: ${{ contains(env.python_version, '3.10') }}
run: |
py -${{ matrix.python-version }}-64 -m PyInstaller "mangadex-dl_x64.spec" --distpath "./dist_x64"
py -${{ matrix.python-version }}-32 -m PyInstaller "mangadex-dl_x86.spec" --distpath "./dist_x86"
- name: Run compiled script
if: ${{ contains(env.python_version, '3.10') }}
run: |
& ".\dist_x64\mangadex-dl_x64\mangadex-dl_x64.exe" --version
& ".\dist_x86\mangadex-dl_x86\mangadex-dl_x86.exe" --version
- name: Cleanup build
if: contains(env.python_version, '3.10')
run: |
# x86 executable
copy "LICENSE" "dist_x86\mangadex-dl_x86"
copy "README.md" "dist_x86\mangadex-dl_x86"
copy "docs\changelog.md" "dist_x86\mangadex-dl_x86"
echo "mangadex-dl.exe --update" | Out-File -FilePath "dist_x86\mangadex-dl_x86\update.bat"
echo "start cmd" | Out-File -FilePath "dist_x86\mangadex-dl_x86\start cmd.bat"
Rename-Item -Path "dist_x86\mangadex-dl_x86\mangadex-dl_x86.exe" -NewName "mangadex-dl.exe"
Rename-Item -Path "dist_x86\mangadex-dl_x86" -NewName "mangadex-dl"
Compress-Archive -Path "dist_x86\mangadex-dl" -DestinationPath "mangadex-dl_x86.zip"
# x64 executable
copy "LICENSE" "dist_x64\mangadex-dl_x64"
copy "README.md" "dist_x64\mangadex-dl_x64"
copy "docs\changelog.md" "dist_x64\mangadex-dl_x64"
echo "mangadex-dl.exe --update" | Out-File -FilePath "dist_x64\mangadex-dl_x64\update.bat"
echo "start cmd" | Out-File -FilePath "dist_x64\mangadex-dl_x64\start cmd.bat"
Rename-Item -Path "dist_x64\mangadex-dl_x64\mangadex-dl_x64.exe" -NewName "mangadex-dl.exe"
Rename-Item -Path "dist_x64\mangadex-dl_x64" -NewName "mangadex-dl"
Compress-Archive -Path "dist_x64\mangadex-dl" -DestinationPath "mangadex-dl_x64.zip"
- name: Upload artifact (x64)
if: contains(env.python_version, '3.10')
uses: actions/upload-artifact@v3
with:
name: mangadex-dl_x64
path: dist_x64/mangadex-dl/
- name: Upload artifact (x86)
if: contains(env.python_version, '3.10')
uses: actions/upload-artifact@v3
with:
name: mangadex-dl_x86
path: dist_x86/mangadex-dl/
# Only build docs in Python 3.10
- name: Build docs
if: contains(env.python_version, '3.10')
run: |
cd docs
sphinx-build -M "html" "." "_build"