-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (87 loc) · 3.66 KB
/
Copy pathbuild-asyncpg.yml
File metadata and controls
97 lines (87 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
---
# This workflow is based on: https://github.com/MagicStack/asyncpg/blob/v0.31.0/.github/workflows/release.yml
name: Build asyncpg wheels (riscv64)
on:
workflow_dispatch:
inputs:
version:
description: 'asyncpg version to build (PyPI version, e.g. 0.31.0)'
required: true
default: '0.31.0'
pull_request:
paths:
- '.github/workflows/build-asyncpg.yml'
concurrency:
group: ${{ github.workflow }}-${{ inputs.version || '0.31.0' }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
env:
# `inputs.version` is empty on pull_request events; default to 0.31.0 there.
ASYNCPG_VERSION: ${{ inputs.version || '0.31.0' }}
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64
jobs:
build_wheels:
name: Build asyncpg ${{ inputs.version || '0.31.0' }} ${{ matrix.python }}-manylinux_riscv64
runs-on: ubuntu-24.04-riscv
timeout-minutes: 180
strategy:
fail-fast: false
matrix:
# Per-interpreter (not abi3): PyPI ships a cpXY-cpXY wheel for each.
python:
- "cp312"
- "cp313"
- "cp314"
- "cp314t"
steps:
- name: Checkout asyncpg v${{ env.ASYNCPG_VERSION }}
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: MagicStack/asyncpg
ref: v${{ env.ASYNCPG_VERSION }}
submodules: true
persist-credentials: false
- name: Build wheels
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
with:
output-dir: wheelhouse/
only: ${{ matrix.python }}-manylinux_riscv64
env:
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
# Upstream's before-all scripts only know debian/almalinux/centos/alpine and
# bail on the Rocky 10 riscv64 image; install the same packages directly.
CIBW_BEFORE_ALL_LINUX: >-
dnf install -y --setopt=install_weak_deps=False
postgresql-server postgresql-contrib libpq-devel
krb5-server krb5-workstation krb5-devel
&& useradd -m -s /bin/bash apgtest
# setuptools 82 dropped pkg_resources, which setup.py imports to cythonise;
# pyproject only floors setuptools, so pin it and drop build isolation.
CIBW_BEFORE_BUILD: pip install "setuptools<82" "Cython>=3.2.1,<4.0.0" wheel
CIBW_BUILD_FRONTEND: "build; args: --no-isolation"
# uvloop, in upstream's inherited `test` group, has no riscv64 wheel on PyPI.
CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: asyncpg-${{ env.ASYNCPG_VERSION }}-${{ matrix.python }}-manylinux_riscv64
path: wheelhouse/*.whl
if-no-files-found: error
publish:
name: Publish asyncpg ${{ inputs.version || '0.31.0' }} to GitLab
needs: [build_wheels]
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Publish wheels and open docs PR
uses: riseproject-dev/python-wheels/actions/publish-wheels@main
with:
artifact-pattern: asyncpg-${{ env.ASYNCPG_VERSION }}-*-manylinux_riscv64
gitlab-username: ${{ vars.GITLAB_DEPLOY_USER }}
gitlab-token: ${{ secrets.GITLAB_DEPLOY_TOKEN }}
gitlab-project-id: ${{ vars.GITLAB_PROJECT_ID }}
gh-token: ${{ secrets.GITHUB_TOKEN }}