Debian Codegraph @

.github/workflows/publish.yml

raw
1 name: Upload Python Package
2
3 on:
4 release:
5 types: [created]
6
7 jobs:
8 build:
9 runs-on: ubuntu-latest
10
11 steps:
12 - uses: actions/checkout@v3
13 - name: Set up Python
14 uses: actions/setup-python@v5
15 with:
16 python-version: "3.x"
17 - name: Install dependencies
18 run: |
19 python -m pip install --upgrade pip
20 pip install build twine
21 - name: Build and check
22 run: |
23 python -m build .
24 twine check dist/*
25 - name: Upload package
26 uses: actions/upload-artifact@v6
27 with:
28 name: packages
29 path: dist/
30 if-no-files-found: error
31 compression-level: 0
32
33 deploy:
34 needs: build
35 runs-on: ubuntu-latest
36
37 permissions:
38 contents: read
39 id-token: write
40
41 environment:
42 name: pypi
43 url: https://pypi.org/p/dateparser
44
45 steps:
46 - name: Download package
47 uses: actions/download-artifact@v7
48 with:
49 name: packages
50 path: dist/
51 - name: Publish package
52 uses: pypa/gh-action-pypi-publish@release/v1
53 with:
54 print-hash: true
55 verbose: true