Skip to content

Commit 47fb443

Browse files
committed
chore: sync from ark-apis 59c90de5ac
Auto-generated SDK sync from ark-apis at 59c90de5ac837a87443bd463e4500f6ef6eceda6. Generated files are overwritten by the sync pipeline and should not be edited by hand. Sync-Source-Commit: a4af56f33cb5a17e0cb8a5c667f8bf5cd6d00d2f Ark-APIs-Commit: 59c90de5ac837a87443bd463e4500f6ef6eceda6 Release-Version: 0.2.0
1 parent a1c3ae5 commit 47fb443

5 files changed

Lines changed: 99 additions & 5 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Python Release
2+
3+
# Publishes the arkruntime package to PyPI (pypi.org/project/arkruntime,
4+
# maintained by the volcengine account). Tags are created exclusively by
5+
# ark-hand after a sync PR lands on main, so a pushed v* tag is always a
6+
# reviewed release snapshot whose tree matches the internal source tree.
7+
#
8+
# The workflow_dispatch input allows re-publishing (or first-publishing)
9+
# an existing tag — e.g. when the PYPI_API_TOKEN secret was missing when
10+
# the tag was originally pushed. The workflow definition runs from the
11+
# ref the dispatch targets, while the build checks out the named tag.
12+
on:
13+
push:
14+
tags:
15+
- "v*"
16+
workflow_dispatch:
17+
inputs:
18+
tag:
19+
description: "Release tag to publish (must already exist, e.g. v0.2.0)"
20+
required: true
21+
type: string
22+
23+
permissions:
24+
contents: read
25+
26+
# Never cancel an in-flight publish; a second dispatch for the same tag
27+
# should queue behind it instead of racing the upload.
28+
concurrency:
29+
group: python-release-${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}
30+
cancel-in-progress: false
31+
32+
jobs:
33+
release:
34+
name: Build and publish to PyPI
35+
runs-on: ubuntu-latest
36+
timeout-minutes: 15
37+
38+
steps:
39+
- name: Resolve release tag
40+
id: tag
41+
env:
42+
DISPATCH_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || '' }}
43+
run: |
44+
tag="${DISPATCH_TAG:-${GITHUB_REF_NAME}}"
45+
case "${tag}" in
46+
v[0-9]*.[0-9]*.0) ;;
47+
*)
48+
echo "::error::${tag} is not a release tag (expected vMAJOR.MINOR.0)"
49+
exit 1
50+
;;
51+
esac
52+
echo "name=${tag}" >> "$GITHUB_OUTPUT"
53+
54+
- name: Check out repository
55+
uses: actions/checkout@v4
56+
with:
57+
ref: ${{ steps.tag.outputs.name }}
58+
59+
- name: Verify pyproject version matches tag
60+
env:
61+
RELEASE_TAG: ${{ steps.tag.outputs.name }}
62+
run: |
63+
version="${RELEASE_TAG#v}"
64+
if ! grep -Eq "^version = \"${version}\"$" pyproject.toml; then
65+
echo "::error::pyproject.toml version does not match tag ${RELEASE_TAG}"
66+
grep -n '^version' pyproject.toml || true
67+
exit 1
68+
fi
69+
70+
- name: Set up Python
71+
uses: actions/setup-python@v5
72+
with:
73+
python-version: "3.12"
74+
75+
- name: Install uv
76+
run: python -m pip install --disable-pip-version-check --quiet uv
77+
78+
- name: Build sdist and wheel
79+
run: uv build
80+
81+
- name: Check PyPI token
82+
env:
83+
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
84+
run: |
85+
if [ -z "${PYPI_API_TOKEN}" ]; then
86+
echo "::error::secret PYPI_API_TOKEN is not configured on this repository"
87+
exit 1
88+
fi
89+
90+
- name: Publish to PyPI
91+
uses: pypa/gh-action-pypi-publish@release/v1
92+
with:
93+
password: ${{ secrets.PYPI_API_TOKEN }}
94+
attestations: false

‎VERSION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.0
1+
0.2.0

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "arkruntime"
7-
version = "0.1.0"
7+
version = "0.2.0"
88
description = "Ark runtime SDK for Python"
99
readme = "README.md"
1010
requires-python = ">=3.8"

‎src/arkruntime/types/images/usage.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515

1616
class Usage(BaseModel):
17-
input_images: int
17+
input_images: Optional[int] = None
1818
"""
19-
Number of reference images supplied by the client.
19+
Number of reference images supplied by the client. May be absent in responses from older services.
2020
"""
2121
generated_images: int
2222
"""

‎uv.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)