Skip to content

Commit

Permalink
Update GTK stack for use in CI/CD
Browse files Browse the repository at this point in the history
Clarified a little what this commit actually does.
  • Loading branch information
Lord-Kamina committed Feb 2, 2025
1 parent 8df36c4 commit 404edd9
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 10 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,18 @@ on:
ref:
description: "Enter a tag or commit to package"
default: ""
gvsbuild-tag:
description: "Use an alternative gvsbuild release for the windows build. Defaults to latest."
default: "latest"

jobs:
windows_package:
runs-on: windows-2022
if: (github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'package'))
strategy:
matrix:
arch: [x64, x86]
python: ["3.9"]
arch: [x64]
python: ["3.10"]
libtorrent: [2.0.7, 1.2.19]

steps:
Expand All @@ -49,12 +52,20 @@ jobs:
cache: pip

- name: Prepare pip
run: python -m pip install wheel setuptools==68.*
run: python -m pip install wheel setuptools==70.*

- name: Determine gvsbuild release URL
id: gvsbuild-url
shell: bash
run: |
test -z "${{ github.event.inputs.gvsbuild-tag }}" && tag=latest || tag="${{ github.event.inputs.gvsbuild-tag }}"
if [[ "$tag" == "latest" ]]; then URL="https://github.com/${{ github.repository_owner }}/gvsbuild-release/releases/$tag/download"; else URL="https://github.com/${{ github.repository_owner }}/gvsbuild-release/releases/download/$tag" ; fi
echo "gvsbuild-release-url=$URL" >> $GITHUB_OUTPUT
- name: Install GTK
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")
$WebClient.DownloadFile("${{ steps.gvsbuild-url.outputs.gvsbuild-release-url }}/gvsbuild-py${{ matrix.python }}-vs17-${{ matrix.arch }}.zip","C:\GTK.zip")
7z x C:\GTK.zip -oc:\GTK
echo "C:\GTK\release\lib" | Out-File -FilePath $env:GITHUB_PATH -Append
echo "C:\GTK\release\bin" | Out-File -FilePath $env:GITHUB_PATH -Append
Expand Down
33 changes: 29 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@ on:
core-dump:
description: "Set to 1 to enable retrieving core dump from crashes"
default: "0"
gvsbuild-tag:
description: "Use an alternative gvsbuild release for the windows build. Defaults to latest."
default: "latest"
jobs:
test-linux:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.7", "3.10"]

python-version: ["3.9", "3.10"]
os: ["ubuntu-24.04"]
include:
- os: ubuntu-22.04
python-version: 3.7
runs-on: ${{ matrix.os }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
Expand Down Expand Up @@ -74,7 +80,8 @@ jobs:
runs-on: windows-2022
strategy:
matrix:
python-version: ["3.7", "3.10"]
python-version: ["3.7", "3.9", "3.10"]
arch: ["x64"]

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
Expand All @@ -89,6 +96,24 @@ jobs:
cache: "pip"
cache-dependency-path: "requirements*.txt"

- name: Determine gvsbuild release URL
id: gvsbuild-url
shell: bash
run: |
test -z "${{ github.event.inputs.gvsbuild-tag }}" && tag=latest || tag="${{ github.event.inputs.gvsbuild-tag }}"
if [[ "$tag" == "latest" ]]; then URL="https://github.com/${{ github.repository_owner }}/gvsbuild-release/releases/$tag/download"; else URL="https://github.com/${{ github.repository_owner }}/gvsbuild-release/releases/download/$tag" ; fi
echo "gvsbuild-release-url=$URL" >> $GITHUB_OUTPUT
- name: Install GTK
run: |
$WebClient = New-Object System.Net.WebClient
$WebClient.DownloadFile("${{ steps.gvsbuild-url.outputs.gvsbuild-release-url }}/gvsbuild-py${{ matrix.python-version }}-vs17-${{matrix.arch}}.zip","C:\GTK.zip")
7z x C:\GTK.zip -oc:\GTK
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
python -m pip install --no-index --find-links="C:\GTK\release\python" pycairo PyGObject
- name: Install dependencies
run: |
pip install --upgrade pip wheel setuptools
Expand Down
2 changes: 1 addition & 1 deletion requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
libtorrent
libtorrent==2.0.7
pytest
pytest-twisted
pytest-cov
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
libtorrent
twisted[tls]>=17.1
twisted[tls]>=17.1,<=24.7
twisted[tls]<23,>=17.1; sys_platform == 'win32'
rencode
pyopenssl
Expand Down

0 comments on commit 404edd9

Please sign in to comment.