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

6
builder/package.py

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

2
builder/requirements.txt

@ -1,5 +1,5 @@
# Basic build requirements # Basic build requirements
pyinstaller==4.2 pyinstaller
setuptools setuptools
pkginfo pkginfo
certifi 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 import shutil
from distutils.dir_util import copy_tree
from unittest import mock from unittest import mock
from sabnzbd.postproc import * from sabnzbd.postproc import *
@ -35,8 +34,7 @@ class TestPostProc:
# create a fresh copy # create a fresh copy
try: try:
# shutil.copytree(sourcedir, workingdir) gives problems on AppVeyor, so: shutil.copytree(sourcedir, workingdir)
copy_tree(sourcedir, workingdir)
except: except:
pytest.fail("Could not create copy of files for rar_renamer") pytest.fail("Could not create copy of files for rar_renamer")

Loading…
Cancel
Save