Repository navigation
59 lines (59 loc) · 1.84 KB
/
Copy pathpackage.yaml
File metadata and controls
59 lines (59 loc) · 1.84 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
# Publish to PyPI
#
# Uses PyPI trusted publishing (OIDC), so no token is stored here. Requires a trusted
# publisher on PyPI for this repository, workflow `package.yaml` and environment `pypi`.
# The man page is generated as part of the build, so the sdist matches `package/roll.sh`.
name: package
on:
workflow_dispatch:
release:
types: [published]
jobs:
build:
if: github.repository == 'python-validators/validators'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
# checkout repository (for a release, the tagged commit)
- name: Checkout repository
uses: actions/checkout@v7
# set up uv and a specific python version
- name: Set up uv with Python v3.11
uses: astral-sh/setup-uv@v10.3.0
with:
python-version: "3.11"
# build package: generates the man page, then runs `uv build`
# (`SOURCE_DATE_EPOCH` makes the wheel reproducible)
- name: Build package
run: |
SOURCE_DATE_EPOCH="$(git log -1 --format=%ct)"
export SOURCE_DATE_EPOCH
uv run --locked --no-editable --group docs-offline --extra crypto-eth-addresses \
python package/export pkg
- name: Show checksums
run: sha256sum dist/*
# upload package as artifact
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
if-no-files-found: error
publish:
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/validators
permissions:
id-token: write
steps:
- name: Download artifact
uses: actions/download-artifact@v8
with:
name: dist
path: dist/
# publish package
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1