-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (32 loc) · 1.25 KB
/
publish-python-bootstrap.yml
File metadata and controls
41 lines (32 loc) · 1.25 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
name: Publish Python Bootstrap
# Builds and publishes the pure-Python `a3s-code` bootstrap shim to PyPI.
# The shim is tiny (no native code) so it sails under PyPI's per-project
# size cap. On first `import a3s_code` it downloads the matching native
# wheel for the user's platform from this repo's GitHub Releases.
on:
workflow_call:
workflow_dispatch:
jobs:
publish:
name: Publish Python Bootstrap to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install build dependencies
run: python -m pip install --upgrade pip build twine
- name: Run bootstrap unit tests
working-directory: sdk/python-bootstrap
run: python -m unittest tests.test_bootstrap -v
- name: Build wheel + sdist
run: python -m build --wheel --sdist sdk/python-bootstrap
- name: Twine check
run: python -m twine check sdk/python-bootstrap/dist/*
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_NATIVE_TOKEN }}
run: python -m twine upload --skip-existing sdk/python-bootstrap/dist/*