Repository navigation
64 lines (59 loc) · 2.31 KB
/
Copy pathpython-package.yml
File metadata and controls
64 lines (59 loc) · 2.31 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
name: Python package
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: python-package-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.12'
- run: python -m pip install -r requirements-python-build.txt
- run: python -B -m unittest discover -s tests -p test_python_cli.py -v
- run: python -m build
- run: python -m twine check --strict dist/*
- name: Rebuild wheel from source distribution
run: python -m pip wheel --no-deps --wheel-dir rebuilt dist/*.tar.gz
- name: Verify the native toolkit archive
run: |
python .github/scripts/build_release.py native
PYTHONPATH=src python -c 'from pathlib import Path; from tempfile import TemporaryDirectory; from mooship.install import unpack_release, verify_checksum; from mooship import __version__; a = next(Path("native").glob("*.tar.gz")); verify_checksum(a, a.with_name(a.name + ".sha256"), a.name); t = TemporaryDirectory(); unpack_release(a, Path(t.name) / "unpacked", __version__); t.cleanup()'
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: python-distributions
path: rebuilt/*.whl
if-no-files-found: error
retention-days: 7
install:
needs: build
runs-on: ubuntu-24.04
timeout-minutes: 10
strategy:
matrix:
python: ['3.8', '3.12', '3.14']
steps:
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: ${{ matrix.python }}
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: python-distributions
path: dist/
- run: python -m pip install --no-deps dist/*.whl
- run: |
mooship --version
mooship --help
mooship install --directory "$RUNNER_TEMP/mooship-preview" --dry-run
python -m mooship --version