2022-01-20 15:31:15 +00:00
|
|
|
name: Package
|
2022-01-04 05:56:11 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-01-13 21:25:54 +00:00
|
|
|
tags:
|
|
|
|
- "deluge-*"
|
2022-01-13 22:36:56 +00:00
|
|
|
- "!deluge*-dev*"
|
2022-01-13 21:25:54 +00:00
|
|
|
branches:
|
|
|
|
- develop
|
2022-01-04 05:56:11 +00:00
|
|
|
pull_request:
|
2022-01-13 21:25:54 +00:00
|
|
|
types: [labeled, opened, synchronize, reopened]
|
2022-01-04 05:56:11 +00:00
|
|
|
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
|
|
workflow_dispatch:
|
2022-01-30 17:03:19 +00:00
|
|
|
inputs:
|
|
|
|
ref:
|
|
|
|
description: "Enter a tag or commit to package"
|
|
|
|
default: ""
|
2022-01-04 05:56:11 +00:00
|
|
|
|
|
|
|
jobs:
|
2022-01-20 15:31:15 +00:00
|
|
|
windows_package:
|
2022-01-21 10:16:15 +00:00
|
|
|
runs-on: windows-2019
|
2022-01-21 12:20:37 +00:00
|
|
|
if: (github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'package'))
|
2022-01-04 05:56:11 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
arch: [x64, x86]
|
|
|
|
python: [3.9]
|
2022-01-20 15:31:15 +00:00
|
|
|
libtorrent: [2.0.5, 1.2.15]
|
2022-01-04 05:56:11 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2022-01-30 17:42:15 +00:00
|
|
|
|
|
|
|
# Checkout Deluge source to subdir to enable packaging any tag/commit
|
|
|
|
- name: Checkout Deluge source
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
2022-01-30 17:03:19 +00:00
|
|
|
ref: ${{ github.event.inputs.ref }}
|
2022-02-01 06:45:10 +00:00
|
|
|
fetch-depth: 0
|
2022-01-30 17:42:15 +00:00
|
|
|
path: deluge_src
|
2022-01-04 05:56:11 +00:00
|
|
|
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python}}
|
|
|
|
architecture: ${{ matrix.arch }}
|
|
|
|
|
|
|
|
- name: Cache pip
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: '%LOCALAPPDATA%\pip\Cache'
|
|
|
|
# Look to see if there is a cache hit for the corresponding requirements file
|
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('tox.ini', 'setup.py', 'requirements*.txt') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
${{ runner.os }}-
|
|
|
|
|
2022-01-21 11:28:35 +00:00
|
|
|
- name: Prepare pip
|
|
|
|
run: python -m pip install --upgrade pip wheel
|
|
|
|
|
|
|
|
- name: Install GTK
|
2022-01-04 05:56:11 +00:00
|
|
|
run: |
|
|
|
|
$WebClient = New-Object System.Net.WebClient
|
|
|
|
$WebClient.DownloadFile("https://github.com/deluge-torrent/gvsbuild-release/releases/download/latest/gvsbuild-py${{ matrix.python }}-vs16-${{ matrix.arch }}.zip","C:\GTK.zip")
|
|
|
|
7z x C:\GTK.zip -oc:\GTK
|
2022-01-21 11:28:35 +00:00
|
|
|
echo "C:\GTK\release\lib" | Out-File -FilePath $env:GITHUB_PATH -Append
|
|
|
|
echo "C:\GTK\release\bin" | Out-File -FilePath $env:GITHUB_PATH -Append
|
|
|
|
echo "C:\GTK\release" | Out-File -FilePath $env:GITHUB_PATH -Append
|
|
|
|
|
|
|
|
- name: Install Python dependencies
|
|
|
|
run: >
|
|
|
|
python -m pip install --find-links="C:\GTK\release\python" pycairo PyGObject
|
|
|
|
|
|
|
|
python -m pip install
|
2022-02-08 19:29:11 +00:00
|
|
|
twisted==22.2.0rc1 # Windows simulate fix
|
2022-01-21 11:28:35 +00:00
|
|
|
libtorrent==${{ matrix.libtorrent }}
|
|
|
|
pyinstaller
|
2022-01-14 13:05:23 +00:00
|
|
|
pygame
|
2022-01-21 11:28:35 +00:00
|
|
|
-r requirements.txt
|
2022-01-04 05:56:11 +00:00
|
|
|
|
|
|
|
- name: Install Deluge
|
2022-01-30 17:42:15 +00:00
|
|
|
working-directory: deluge_src
|
2022-01-04 05:56:11 +00:00
|
|
|
run: |
|
2022-01-21 11:28:35 +00:00
|
|
|
python -m pip install .
|
2022-01-04 05:56:11 +00:00
|
|
|
python setup.py install_scripts
|
|
|
|
|
|
|
|
- name: Freeze Deluge
|
|
|
|
run: |
|
|
|
|
pyinstaller --clean $env:GITHUB_WORKSPACE\packaging\win\delugewin.spec --distpath $env:GITHUB_WORKSPACE\packaging\win\freeze
|
|
|
|
|
2022-01-11 04:49:44 +00:00
|
|
|
- name: Fix OpenSSL For Libtorrent
|
|
|
|
if: ${{ matrix.arch == 'x64' }}
|
|
|
|
run: |
|
|
|
|
Copy-Item -Path $env:GITHUB_WORKSPACE\packaging\win\freeze\Deluge\libssl-1_1.dll -Destination $env:GITHUB_WORKSPACE\packaging\win\freeze\Deluge\libssl-1_1-x64.dll
|
|
|
|
Copy-Item -Path $env:GITHUB_WORKSPACE\packaging\win\freeze\Deluge\libcrypto-1_1.dll -Destination $env:GITHUB_WORKSPACE\packaging\win\freeze\Deluge\libcrypto-1_1-x64.dll
|
|
|
|
|
2022-01-04 05:56:11 +00:00
|
|
|
- name: Make Deluge Installer
|
|
|
|
working-directory: ./packaging/win
|
|
|
|
run: |
|
|
|
|
python setup_nsis.py
|
|
|
|
makensis /Darch=${{ matrix.arch }} deluge-win-installer.nsi
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2022-01-20 15:31:15 +00:00
|
|
|
name: deluge-py${{ matrix.python }}-lt${{ matrix.libtorrent }}-${{ matrix.arch }}
|
2022-01-04 05:56:11 +00:00
|
|
|
path: packaging/win/*.exe
|