You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

114 lines
4.2 KiB

name: Build binaries and source distribution
on: [push, pull_request]
jobs:
build_windows:
name: Build Windows binary
runs-on: windows-latest
env:
AUTOMATION_GITHUB_TOKEN: ${{ secrets.AUTOMATION_GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9 (64bit)
uses: actions/setup-python@v2
with:
python-version: 3.9
architecture: x64
- name: Install Python dependencies (64bit)
run: |
python --version
pip install --upgrade pip wheel
pip install --upgrade -r requirements.txt
pip install --upgrade -r builder/requirements.txt
- name: Build source distribution
run: python builder/package.py source
- name: Upload source distribution
uses: actions/upload-artifact@v2
with:
path: "*-src.tar.gz"
name: Source distribution
- name: Build Windows standalone binary and installer (64bit)
run: python builder/package.py installer
- name: Upload Windows standalone binary (64bit)
uses: actions/upload-artifact@v2
with:
path: "*-win64-bin.zip"
name: Windows Windows standalone binary (64bit)
- name: Upload Windows installer (64bit)
uses: actions/upload-artifact@v2
with:
path: "*-win-setup.exe"
name: Windows installer
- name: Set up Python 3.8 (32bit and legacy)
uses: actions/setup-python@v2
with:
python-version: 3.8
architecture: x86
- name: Install Python dependencies (32bit and legacy)
run: |
python --version
pip install --upgrade pip wheel
pip install --upgrade -r requirements.txt
pip install --upgrade -r builder/requirements.txt
- name: Build Windows standalone binary (32bit and legacy)
run: python builder/package.py binary
- name: Upload Windows standalone binary (32bit and legacy)
uses: actions/upload-artifact@v2
with:
path: "*-win32-bin.zip"
name: Windows Windows standalone binary (32bit and legacy)
- name: Prepare official release
if: env.AUTOMATION_GITHUB_TOKEN && !startsWith(github.ref, 'refs/tags/')
run: python builder/package.py release
build_macos:
name: Build macOS binary
runs-on: macos-latest
env:
SIGNING_AUTH: ${{ secrets.SIGNING_AUTH }}
NOTARIZATION_USER: ${{ secrets.NOTARIZATION_USER }}
NOTARIZATION_PASS: ${{ secrets.NOTARIZATION_PASS }}
AUTOMATION_GITHUB_TOKEN: ${{ secrets.AUTOMATION_GITHUB_TOKEN }}
# 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.2
MACOSX_DEPLOYMENT_TARGET: 10.9
steps:
- uses: actions/checkout@v2
- name: Cache Python download
id: cache-python-download
uses: actions/cache@v2
with:
path: ~/python.pkg
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
- name: Install Python
run: sudo installer -pkg ~/python.pkg -target /
- name: Install Python dependencies
run: |
python3 --version
pip3 install --upgrade pip wheel
pip3 install --upgrade -r requirements.txt
pip3 install --upgrade -r builder/requirements.txt
- name: Import macOS codesign certificates
uses: apple-actions/import-codesign-certs@v1
if: env.SIGNING_AUTH
with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- name: Build macOS binary
run: |
python3 builder/package.py app
python3 builder/make_dmg.py
- name: Upload macOS binary
uses: actions/upload-artifact@v2
with:
path: "*-osx.dmg"
name: macOS binary (not notarized)
- name: Prepare official release
if: env.AUTOMATION_GITHUB_TOKEN && !startsWith(github.ref, 'refs/tags/')
run: python3 builder/package.py release