-
-
Notifications
You must be signed in to change notification settings - Fork 92
73 lines (67 loc) · 1.72 KB
/
publish.yml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Publish
on:
push:
tags:
- 'release_*'
workflow_dispatch: {}
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel flake8
- name: Build
run: |
make build
- name: Unit Tests
run: |
cd build/dist/pytz/tests
python test_lazy.py -vv
python test_tzinfo.py -vv
- name: Documentation Tests
run: |
cd build/dist/pytz/tests
python test_docs.py -vv
- name: zdump Tests
run: |
python gen_tests.py
python test_zdump.py -vv
- name: Build distribution
run: |
make clean dist
- uses: actions/upload-artifact@v3
with:
path: ./build/tarballs
pypi-publish:
needs: ['build']
environment: 'publish'
name: Upload release to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: artifact/
gh-publish:
needs: ['build']
environment: 'ghpublish'
name: Upload release to Github
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
- name: Github Release
uses: softprops/action-gh-release@v1
with:
files: artifact/*