-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (90 loc) · 3.56 KB
/
Copy pathbuild-orjson.yml
File metadata and controls
100 lines (90 loc) · 3.56 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
98
99
100
# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
#
# This workflow is based on: https://github.com/ijl/orjson/blob/master/.github/workflows/artifact.yaml
name: Build orjson wheels (riscv64)
on:
workflow_dispatch:
inputs:
version:
description: 'orjson version to build (git tag without leading v, e.g. 3.12.0)'
required: true
default: '3.12.0'
pull_request:
paths:
- '.github/workflows/build-orjson.yml'
concurrency:
group: ${{ github.workflow }}-${{ inputs.version || '3.12.0' }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
env:
# `inputs.version` is empty on pull_request events; default to 3.12.0 there.
ORJSON_VERSION: ${{ inputs.version || '3.12.0' }}
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64
RUST_TOOLCHAIN: "nightly-2026-08-01"
jobs:
manylinux:
name: Build orjson ${{ inputs.version || '3.12.0' }} ${{ matrix.python }}-manylinux_riscv64
runs-on: ubuntu-24.04-riscv
strategy:
fail-fast: false
matrix:
# No freethreaded (3.14t) entry: upstream only builds freethreaded
# wheels in manylinux_fedora, which forwards the
# ORJSON_BUILD_FREETHREADED/UNSAFE_PYO3_BUILD_FREE_THREADED env vars
# into its container automatically. This job's `podman run` only
# forwards the -e vars listed below, matching manylinux_pypa upstream.
python: ['python3.12', 'python3.13', 'python3.14']
steps:
- name: Checkout orjson v${{ env.ORJSON_VERSION }}
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: ijl/orjson
ref: ${{ env.ORJSON_VERSION }}
persist-credentials: false
- name: Build and test
shell: bash
run: |
podman run -t \
--log-driver=none \
--network=host \
-v $(pwd):/workspace \
--workdir /workspace \
-e CFLAGS="-O2 -fstrict-aliasing" \
-e LDFLAGS="-Wl,--as-needed" \
-e PYTHON="${{ matrix.python }}" \
-e RUST_TOOLCHAIN="${{ env.RUST_TOOLCHAIN }}" \
-e ORJSON_COMPATIBILITY="manylinux_2_39" \
-e ORJSON_TAG="manylinux_2_39_riscv64" \
-e ORJSON_FEATURES="no_panic,optimize" \
-e RUSTFLAGS="-Z unstable-options -C panic=immediate-abort -Z mir-opt-level=4 -D warnings" \
-e TARGET="riscv64gc-unknown-linux-gnu" \
--pull=newer \
"${{ env.MANYLINUX_RISCV64_IMAGE }}" \
bash -c "ci/manylinux.sh"
- name: Store wheels
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: "orjson-${{ env.ORJSON_VERSION }}-${{ matrix.python }}-manylinux_riscv64"
path: target/wheels
overwrite: true
retention-days: 1
if-no-files-found: error
compression-level: 0
publish:
name: Publish orjson ${{ inputs.version || '3.12.0' }} to GitLab
needs: [manylinux]
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: orjson-${{ env.ORJSON_VERSION }}-*
gitlab-username: ${{ vars.GITLAB_DEPLOY_USER }}
gitlab-token: ${{ secrets.GITLAB_DEPLOY_TOKEN }}
gitlab-project-id: ${{ vars.GITLAB_PROJECT_ID }}
gh-token: ${{ secrets.GITHUB_TOKEN }}