Skip to content

Commit e8c5386

Browse files
committed
Initial publication
0 parents  commit e8c5386

13 files changed

Lines changed: 616 additions & 0 deletions

File tree

.github/workflows/build.yaml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# SPDX-FileCopyrightText: 2026 geisserml <geisserml@gmail.com>
2+
# SPDX-License-Identifier: BSD-3-Clause
3+
4+
name: Build
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
cibw_py_ver:
9+
type: string
10+
default: 'cp314'
11+
publish:
12+
type: boolean
13+
default: false
14+
prerelease:
15+
type: boolean
16+
default: false
17+
18+
jobs:
19+
20+
build:
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
cibw_os: ["manylinux", "musllinux"]
25+
cibw_arch: ["x86_64", "i686", "aarch64", "armv7l", "ppc64le", "s390x", "riscv64", "loongarch64"]
26+
27+
uses: ./.github/workflows/cibw_one.yaml
28+
with:
29+
os: ${{ (matrix.cibw_arch == 'aarch64' || matrix.cibw_arch == 'armv7l') && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
30+
cibw_os: ${{ matrix.cibw_os }}
31+
cibw_arch: ${{ matrix.cibw_arch }}
32+
cibw_py_ver: ${{ inputs.cibw_py_ver }}
33+
34+
35+
sdist:
36+
runs-on: ubuntu-latest
37+
steps:
38+
39+
- name: Check out the repo
40+
uses: actions/checkout@v6
41+
with:
42+
persist-credentials: false
43+
fetch-depth: 0
44+
45+
- name: Set up Python
46+
uses: actions/setup-python@v6
47+
with:
48+
python-version: '3.14'
49+
pip-install: build setuptools
50+
51+
- name: Package sdist
52+
run: python3 -m build -sxn
53+
54+
- name: Upload sdist
55+
uses: actions/upload-artifact@v7
56+
with:
57+
path: ./dist/*.tar.gz
58+
name: sdist
59+
60+
61+
publish:
62+
needs: [build, sdist]
63+
if: ${{ inputs.publish && !cancelled() && !contains(needs.*.result, 'failure') }}
64+
runs-on: ubuntu-latest
65+
66+
environment: release # PyPI upload via "trusted publishing"
67+
permissions:
68+
id-token: write # PyPI upload via "trusted publishing", and GH attestation
69+
attestations: write # GH attestation
70+
71+
steps:
72+
73+
- name: Download sdist
74+
uses: actions/download-artifact@v8
75+
with:
76+
path: dist/
77+
name: sdist
78+
79+
- name: Determine version from sdist
80+
id: get_version
81+
run: # q&d
82+
VERSION=$(ls dist/*.tar.gz)
83+
VERSION=${VERSION##*-}
84+
VERSION=${VERSION%%.*}
85+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
86+
87+
- name: Download wheels
88+
uses: actions/download-artifact@v8
89+
with:
90+
path: dist/
91+
merge-multiple: true
92+
pattern: cibw-*
93+
94+
- name: Isolate non-PyPI builds
95+
run: |
96+
mkdir gh_only
97+
mv dist/*linux_*_loongarch64*.whl gh_only/
98+
99+
- name: Publish to TestPyPI
100+
uses: pypa/gh-action-pypi-publish@release/v1
101+
with:
102+
repository-url: https://test.pypi.org/legacy/
103+
packages-dir: dist/
104+
attestations: false
105+
verbose: true
106+
107+
- name: Attest build provenance
108+
id: provenance
109+
uses: actions/attest-build-provenance@v4
110+
with:
111+
subject-path: 'dist/*, gh_only/*'
112+
113+
- name: Rename provenance file
114+
run: mv "$SRC_PATH" gn-attestation.json
115+
env:
116+
SRC_PATH: ${{ steps.provenance.outputs.bundle-path }}
117+
118+
- name: Publish to GitHub
119+
uses: ncipollo/release-action@v1
120+
with:
121+
immutableCreate: true
122+
artifacts: 'dist/*.whl,gh_only/*.whl,dist/*.tar.gz,gn-attestation.json'
123+
token: ${{ secrets.GITHUB_TOKEN }}
124+
tag: ${{ steps.get_version.outputs.version }}
125+
prerelease: ${{ inputs.prerelease }}
126+
127+
- name: Publish to PyPI
128+
uses: pypa/gh-action-pypi-publish@release/v1
129+
with:
130+
packages-dir: dist/

.github/workflows/build_one.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# SPDX-FileCopyrightText: 2026 geisserml <geisserml@gmail.com>
2+
# SPDX-License-Identifier: BSD-3-Clause
3+
4+
name: Build one
5+
on:
6+
workflow_call:
7+
inputs: &reusable_inputs
8+
os:
9+
type: string
10+
required: true
11+
cibw_os:
12+
type: string
13+
required: true
14+
cibw_arch:
15+
type: string
16+
required: true
17+
cibw_py_ver:
18+
type: string
19+
default: 'cp314'
20+
# condition:
21+
# type: boolean
22+
# default: true
23+
workflow_dispatch:
24+
inputs: *reusable_inputs
25+
26+
jobs:
27+
28+
build_one:
29+
name: ${{ inputs.cibw_os }}_${{ inputs.cibw_arch }} on ${{ inputs.os }}
30+
runs-on: ${{ inputs.os }}
31+
# if: ${{ inputs.condition }}
32+
33+
steps:
34+
35+
- name: Check out the repo
36+
uses: actions/checkout@v6
37+
with:
38+
persist-credentials: false
39+
fetch-depth: 0
40+
41+
- name: Set up QEMU
42+
if: ${{ !(inputs.cibw_arch == 'x86_64' || inputs.cibw_arch == 'aarch64') }}
43+
uses: docker/setup-qemu-action@v4
44+
45+
- name: Build wheels
46+
uses: loong64/cibuildwheel@dc83b14a5e1c7b76e56a3826b22432c87e1fe5cf # v3.4.1
47+
env:
48+
CIBW_BUILD: "${{ inputs.cibw_py_ver }}-${{ inputs.cibw_os }}_${{ inputs.cibw_arch }}"
49+
CIBW_ARCHS: "${{ inputs.cibw_arch }}"
50+
with:
51+
output-dir: wheelhouse
52+
53+
- name: Upload artifact
54+
uses: actions/upload-artifact@v7
55+
with:
56+
path: ./wheelhouse/*.whl
57+
name: cibw-${{ inputs.cibw_os }}_${{ inputs.cibw_arch }}

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-FileCopyrightText: 2026 geisserml <geisserml@gmail.com>
2+
# SPDX-License-Identifier: BSD-3-Clause
3+
4+
sbuild/
5+
build/
6+
dist/
7+
**/__pycache__
8+
src/*.egg-info
9+
src/gn_dist/gn

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
LICENSES/BSD-3-Clause.txt

LICENSES/BSD-3-Clause.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Copyright (c) 2026 geisserml <geisserml@gmail.com>
2+
Copyright (c) 2015-2026 The Chromium Authors. All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5+
6+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7+
8+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9+
10+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11+
12+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)