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:
|
2023-05-30 16:12:35 +00:00
|
|
|
runs-on: windows-2022
|
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]
|
2022-06-12 18:59:49 +00:00
|
|
|
python: ["3.9"]
|
2023-05-29 13:03:12 +00:00
|
|
|
libtorrent: [2.0.7, 1.2.19]
|
2022-01-04 05:56:11 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
2024-06-23 01:36:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2022-01-04 05:56:11 +00:00
|
|
|
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
|
2024-06-23 01:36:06 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-01-30 17:42:15 +00:00
|
|
|
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
|
2024-06-23 01:36:06 +00:00
|
|
|
uses: actions/setup-python@v5
|
2022-01-04 05:56:11 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python}}
|
|
|
|
architecture: ${{ matrix.arch }}
|
2022-06-12 19:12:30 +00:00
|
|
|
cache: pip
|
2022-01-04 05:56:11 +00:00
|
|
|
|
2022-01-21 11:28:35 +00:00
|
|
|
- name: Prepare pip
|
2023-09-18 10:45:01 +00:00
|
|
|
run: python -m pip install wheel setuptools==68.*
|
2022-01-21 11:28:35 +00:00
|
|
|
|
|
|
|
- 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
|
2022-06-12 19:12:30 +00:00
|
|
|
python -m pip install --no-index --find-links="C:\GTK\release\python" pycairo PyGObject
|
2022-01-21 11:28:35 +00:00
|
|
|
|
|
|
|
- name: Install Python dependencies
|
2023-09-18 12:25:03 +00:00
|
|
|
# Pillow no longer provides 32-bit wheels for Windows
|
|
|
|
# so specify only-binary to install old version.
|
2022-01-21 11:28:35 +00:00
|
|
|
run: >
|
|
|
|
python -m pip install
|
2023-09-18 12:25:03 +00:00
|
|
|
--only-binary=pillow
|
2023-09-18 12:25:03 +00:00
|
|
|
twisted[tls]==22.8.0
|
2022-01-21 11:28:35 +00:00
|
|
|
libtorrent==${{ matrix.libtorrent }}
|
2023-09-18 12:25:03 +00:00
|
|
|
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
|
2022-02-08 19:29:38 +00:00
|
|
|
working-directory: packaging/win
|
2022-01-04 05:56:11 +00:00
|
|
|
run: |
|
2022-02-08 19:29:38 +00:00
|
|
|
pyinstaller --clean delugewin.spec --distpath freeze
|
2022-01-04 05:56:11 +00:00
|
|
|
|
2023-11-23 23:21:59 +00:00
|
|
|
- name: Verify Deluge exes
|
|
|
|
working-directory: packaging/win/freeze/Deluge/
|
2022-01-11 04:49:44 +00:00
|
|
|
run: |
|
2023-11-23 23:21:59 +00:00
|
|
|
deluge-debug.exe -v
|
|
|
|
deluged-debug.exe -v
|
|
|
|
deluge-web-debug.exe -v
|
|
|
|
deluge-console -v
|
2022-01-11 04:49:44 +00:00
|
|
|
|
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
|
|
|
|
|
2024-06-23 01:36:06 +00:00
|
|
|
- uses: actions/upload-artifact@v4
|
2022-01-04 05:56:11 +00:00
|
|
|
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
|