Skip to content

opus: add custom pc file #4

opus: add custom pc file

opus: add custom pc file #4

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@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.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@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Use Python Dependency Cache
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
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
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@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: ${{ env.python_version }}
- name: Use Python Dependency Cache
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
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
- 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.event.release.tag_name }}_x64.zip C:\gtk-build\gtk\x64\release\*
- name: Upload gtk${{ matrix.gtk-version }}_gvsbuild-${{ github.event.release.tag_name }}_x64.zip
if: matrix.gtk-version == '4'
uses: actions/upload-artifact@v3
with:
name: gtk${{ matrix.gtk-version }}_gvsbuild-${{ github.event.release.tag_name }}_x64.zip
path: 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@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
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@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
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@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
name: gvsbuild-${{ github.event.release.tag_name }}.tar.gz
path: dist
- name: Download wheel
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
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@81e9d935c883d0b210363ab89cf05f3894778450 # release/v1