-
Notifications
You must be signed in to change notification settings - Fork 2
47 lines (39 loc) · 1.29 KB
/
Copy pathrelease.yml
File metadata and controls
47 lines (39 loc) · 1.29 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
name: Publish release
on:
release:
types: [published]
permissions:
contents: read
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 15
environment:
name: pypi
url: https://pypi.org/p/django-tink-fields
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.14"
- name: Verify release tag matches package version
run: |
package_version=$(sed -n 's/^__version__ = "\(.*\)"$/\1/p' tink_fields/_version.py)
test "${GITHUB_REF_NAME}" = "v${package_version}"
- name: Build and validate distributions
run: |
python -m pip install --upgrade pip
python -m pip install build twine
python -m build
twine check --strict dist/*
- name: Smoke-test the wheel
run: |
python -m venv /tmp/django-tink-fields-release
/tmp/django-tink-fields-release/bin/pip install dist/*.whl
/tmp/django-tink-fields-release/bin/python -I -c \
"import tink_fields; assert tink_fields.__version__ == '${GITHUB_REF_NAME#v}'"
- name: Publish to PyPI with trusted publishing
uses: pypa/gh-action-pypi-publish@release/v1