forked from bluesky/bluesky-httpserver
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (43 loc) · 1.62 KB
/
Copy pathpython-publish.yml
File metadata and controls
58 lines (43 loc) · 1.62 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
name: Publish the release to PyPI
on:
release:
types: [created]
jobs:
build:
name: Upload to PyPI
permissions:
id-token: write
if: github.repository_owner == 'bluesky'
runs-on: ubuntu-latest
env:
python_env: py313
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
# Need this to get version number from last tag
fetch-depth: 0
- uses: prefix-dev/setup-pixi@v0.10.0
- name: Install dev dependencies
run: |
set -vxeuo pipefail
pixi install --environment=${{ env.python_env }}
pixi list --environment=${{ env.python_env }}
pixi run --environment=${{ env.python_env }} pip list
pixi run --environment=${{ env.python_env }} conda list
- name: Build sdist and wheel
run: >
export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) &&
pixi run --environment=${{ env.python_env }} python -m build
- name: Check for packaging errors
run: pixi run --environment=${{ env.python_env }} twine check --strict dist/*
- name: Install produced wheel
run: pixi run --environment=${{ env.python_env }} pip install dist/*.whl
- name: Test module is importable using the installed wheel
# If more than one module in src/ replace with module name to test
run: pixi run --environment=${{ env.python_env }} python -c "import $(ls --hide='*.egg-info' src | head -1)"
- name: Publish to PyPI using trusted publishing
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: false