Skip to content

Update librsvg to version 2.59.1 #2011

Update librsvg to version 2.59.1

Update librsvg to version 2.59.1 #2011

Workflow file for this run

on:
push:
branches: [main]
pull_request:
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
python_version: '3.12'
name: CI
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ env.python_version }}
- name: Lint with Pre-commit
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
- name: Check Poetry lock file integrity
run: |
python -m pip install --constraint=.github/constraints.txt poetry
poetry config virtualenvs.in-project true
poetry check
test:
needs: lint
name: Test with Python ${{ matrix.python-version }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: windows-latest
timeout-minutes: 60
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Use Python Dependency Cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: ${{ runner.os }}-poetry-
- name: Install Poetry
run: |
python -m pip install --constraint=.github/constraints.txt poetry
poetry config virtualenvs.in-project true
- name: Install Python Dependencies
run: poetry install
- name: Install dependencies
run: |
pip install tox tox-gh-actions
- name: Test with tox
run: tox
build:
needs: lint
name: Build GTK${{ matrix.gtk-version }} Binaries
runs-on: windows-latest
permissions:
contents: write
timeout-minutes: 75
if: "!contains(github.event.head_commit.message, 'skip ci')"
strategy:
matrix:
gtk-version: ['3', '4']
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ env.python_version }}
- name: Use Python Dependency Cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: ${{ runner.os }}-poetry-
- name: Install Poetry
run: |
python -m pip install --constraint=.github/constraints.txt poetry
poetry config virtualenvs.in-project true
- name: Install Python Dependencies
run: poetry install
- name: Build GTK3
if: matrix.gtk-version == '3'
run: >
poetry run gvsbuild build --ninja-opts -j2 gtk3 gtksourceview4 graphene
glib-networking
- name: Build GTK4
if: matrix.gtk-version == '4'
run: > # Use -j2 option to prevent out of memory errors with GitHub Action runners
poetry run gvsbuild build --ninja-opts -j2 --enable-gi --py-wheel gobject-introspection
gtk4 libadwaita gtksourceview5 pygobject pycairo adwaita-icon-theme gtkmm
- name: Copy wheel files
if: matrix.gtk-version == '4'
run: |
New-Item "C:\gtk-build\gtk\x64\release\wheels" -ItemType "directory"
Copy-Item (Resolve-Path C:\gtk-build\build\x64\release\pygobject\dist\PyGObject*.whl) "C:\gtk-build\gtk\x64\release\wheels"
Copy-Item (Resolve-Path C:\gtk-build\build\x64\release\pycairo\dist\pycairo*.whl) "C:\gtk-build\gtk\x64\release\wheels"
- name: Archive GTK runtime
if: matrix.gtk-version == '4'
run: 7z a -tzip GTK${{ matrix.gtk-version }}_Gvsbuild_${{ github.sha }}_x64.zip C:\gtk-build\gtk\x64\release\*
- name: Upload GTK${{ matrix.gtk-version }}_Gvsbuild-${{ github.sha }}_x64.zip
if: matrix.GTK-version == '4'
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: GTK${{ matrix.gtk-version }}_Gvsbuild_${{ github.sha }}_x64.zip
path: GTK${{ matrix.gtk-version }}_Gvsbuild_${{ github.sha }}_x64.zip
- name: Upload Release Assets
if: github.event_name == 'release' && matrix.gtk-version == '4'
env:
GH_TOKEN: ${{ github.token }}
run: |
mv GTK${{ matrix.gtk-version }}_Gvsbuild_${{ github.sha }}_x64.zip GTK${{ matrix.gtk-version }}_Gvsbuild_${{ github.event.release.tag_name }}_x64.zip
gh release upload ${{ github.event.release.tag_name }} "GTK${{ matrix.gtk-version }}_Gvsbuild_${{ github.event.release.tag_name }}_x64.zip"
- name: Create Source Dist and Wheel
if: matrix.gtk-version == '4'
run: poetry build
- name: Upload gvsbuild-${{ github.event.release.tag_name }}.tar.gz
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: github.event_name == 'release' && matrix.gtk-version == '4'
with:
name: gvsbuild-${{ github.event.release.tag_name }}.tar.gz
path: dist/gvsbuild-${{ github.event.release.tag_name }}.tar.gz
- name: Upload gvsbuild-${{ github.event.release.tag_name }}-py3-none-any.whl
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: github.event_name == 'release' && matrix.gtk-version == '4'
with:
name: gvsbuild-${{ github.event.release.tag_name }}-py3-none-any.whl
path: dist/gvsbuild-${{ github.event.release.tag_name }}-py3-none-any.whl
publish-to-pypi:
name: Publish to PyPI (release only)
needs: build
runs-on: ubuntu-22.04
permissions:
id-token: write
if: ${{ github.event_name == 'release' }}
steps:
- name: Download tar.gz
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: gvsbuild-${{ github.event.release.tag_name }}.tar.gz
path: dist
- name: Download wheel
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: gvsbuild-${{ github.event.release.tag_name }}-py3-none-any.whl
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@0ab0b79471669eb3a4d647e625009c62f9f3b241 # release/v1