-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (54 loc) · 1.87 KB
/
Copy pathpublish-packages.yml
File metadata and controls
58 lines (54 loc) · 1.87 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 packages
on:
workflow_call:
inputs:
upload_to_test:
required: true
type: boolean
branch:
required: true
type: string
jobs:
build:
runs-on: ubuntu-24.04
environment: release
permissions:
id-token: write
steps:
- name: Check out repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ inputs.branch }}
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: "3.14"
- name: Install dependencies
run: |
# We must explicitly install the requirements so that we can force
# installation of the local wheel below in case the version conflicts
# with published wheels (typically only possible during testing).
python -m pip install \
-r .github/workflows/environments/requirements/requirements-build.txt \
-r .github/workflows/environments/requirements/requirements.txt \
-r .github/workflows/environments/requirements/requirements-testing.txt
- name: Install pypa/build
run:
python -m pip install build
- name: Build a binary wheel and a source tarball
run:
python -m build --outdir dist/ .
- name: Install wheel
run:
python -m pip install dupin --progress-bar off --no-index -f dist/
- name: Test with pytest
run:
python -m pytest -v tests/
- name: Publish package to TestPyPI
if: ${{ inputs.upload_to_test }}
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
with:
repository-url: https://test.pypi.org/legacy/
- name: Publish package to PyPI
if: ${{ !inputs.upload_to_test }}
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2