-
Notifications
You must be signed in to change notification settings - Fork 2
94 lines (74 loc) · 2.14 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Publish
on:
release:
types: [published]
defaults:
run:
shell: bash
concurrency:
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
PYTHONUNBUFFERED: 1
FORCE_COLOR: 1
permissions:
contents: read
jobs:
build:
if: github.repository == 'jamielinux/pyright-polite'
name: 'Build'
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: 'Harden Runner'
uses: step-security/harden-runner@03bee3930647ebbf994244c21ddbc0d4933aab4f # v2.3.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
files.pythonhosted.org:443
github.com:443
pypi.org:443
- name: 'Checkout'
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
- name: 'Install dependencies'
run: |
python -m pip install --upgrade build
- name: 'Build'
run: |
python -m build
- name: 'Upload dist'
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: dist
path: 'dist/*'
if-no-files-found: error
retention-days: 30
publish:
if: github.repository == 'jamielinux/pyright-polite'
name: 'Publish to PyPI'
timeout-minutes: 20
runs-on: ubuntu-latest
needs: [build]
steps:
- name: 'Harden Runner'
uses: step-security/harden-runner@03bee3930647ebbf994244c21ddbc0d4933aab4f # v2.3.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
pypi.org:443
pypi.python.org:443
upload.pypi.org:443
- name: 'Download dist'
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: dist
path: dist
- name: 'Publish'
uses: pypa/gh-action-pypi-publish@0bf742be3ebe032c25dd15117957dc15d0cfc38d # v1.8.5
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
print-hash: true