Browse Source

Build release using 3.10

Closes #1958
develop
Safihre 4 years ago
parent
commit
b4ad292ec5
  1. 20
      .github/workflows/build_release.yml
  2. 6
      builder/package.py
  3. 2
      builder/requirements.txt
  4. 4
      tests/test_postproc.py

20
.github/workflows/build_release.yml

@ -10,11 +10,11 @@ jobs:
AUTOMATION_GITHUB_TOKEN: ${{ secrets.AUTOMATION_GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9 (64bit)
- name: Set up Python 3.10 (64bit)
uses: actions/setup-python@v2
with:
python-version: 3.9
architecture: x64
python-version: "3.10"
architecture: "x64"
- name: Install Python dependencies (64bit)
run: |
python --version
@ -43,8 +43,8 @@ jobs:
- name: Set up Python 3.8 (32bit and legacy)
uses: actions/setup-python@v2
with:
python-version: 3.8
architecture: x86
python-version: "3.8"
architecture: "x86"
- name: Install Python dependencies (32bit and legacy)
run: |
python --version
@ -73,8 +73,8 @@ jobs:
# We need the official Python, because the GA ones only support newer macOS versions
# The deployment target is picked up by the Python build tools automatically
# If updated, make sure to also set LSMinimumSystemVersion in SABnzbd.spec
PYTHON_VERSION: 3.9.7
MACOSX_DEPLOYMENT_TARGET: 10.9
PYTHON_VERSION: "3.10.0"
MACOSX_DEPLOYMENT_TARGET: "10.9"
steps:
- uses: actions/checkout@v2
- name: Cache Python download
@ -85,15 +85,17 @@ jobs:
key: macOS-Python-${{ env.PYTHON_VERSION }}
- name: Get Python
if: steps.cache-python-download.outputs.cache-hit != 'true'
run: curl https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macosx10.9.pkg -o ~/python.pkg
run: curl https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macos11.pkg -o ~/python.pkg
- name: Install Python
run: sudo installer -pkg ~/python.pkg -target /
- name: Install Python dependencies
# We need to build the PyInstaller bootloader from sources:
# https://github.com/pyinstaller/pyinstaller/issues/6235
run: |
python3 --version
pip3 install --upgrade pip wheel
pip3 install --upgrade -r requirements.txt
pip3 install --upgrade -r builder/requirements.txt
pip3 install --upgrade -r builder/requirements.txt --no-binary pyinstaller
- name: Import macOS codesign certificates
uses: apple-actions/import-codesign-certs@v1
if: env.SIGNING_AUTH

6
builder/package.py

@ -26,7 +26,6 @@ import subprocess
import tarfile
import pkginfo
import github
from distutils.dir_util import copy_tree
VERSION_FILE = "sabnzbd/version.py"
@ -185,8 +184,7 @@ if __name__ == "__main__":
# Run PyInstaller and check output
run_external_command([sys.executable, "-O", "-m", "PyInstaller", "SABnzbd.spec"])
# Use special distutils function to merge the main and console directories
copy_tree("dist/SABnzbd-console", "dist/SABnzbd")
shutil.copytree("dist/SABnzbd-console", "dist/SABnzbd", dirs_exist_ok=True)
safe_remove("dist/SABnzbd-console")
# Remove unwanted DLL's
@ -361,7 +359,7 @@ if __name__ == "__main__":
# Copy all folders and files to the new folder
for source_folder in extra_folders:
copy_tree(source_folder, os.path.join(src_folder, source_folder))
shutil.copytree(source_folder, os.path.join(src_folder, source_folder), dirs_exist_ok=True)
# Copy all files
for source_file in extra_files:

2
builder/requirements.txt

@ -1,5 +1,5 @@
# Basic build requirements
pyinstaller==4.2
pyinstaller
setuptools
pkginfo
certifi

4
tests/test_postproc.py

@ -9,7 +9,6 @@ tests.test_postproc- Tests of various functions in newspack, among which rar_ren
"""
import shutil
from distutils.dir_util import copy_tree
from unittest import mock
from sabnzbd.postproc import *
@ -35,8 +34,7 @@ class TestPostProc:
# create a fresh copy
try:
# shutil.copytree(sourcedir, workingdir) gives problems on AppVeyor, so:
copy_tree(sourcedir, workingdir)
shutil.copytree(sourcedir, workingdir)
except:
pytest.fail("Could not create copy of files for rar_renamer")

Loading…
Cancel
Save