-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (48 loc) · 1.27 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
name: Upload Package to PyPI
on:
release:
types: [created]
jobs:
build:
name: Build packages
runs-on: ubuntu-latest
if: github.repository == 'umr-lops/grdwindinversion'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build twine
- name: Build
run: |
python -m build --sdist --outdir dist/ .
- name: Check the built archives
run: |
twine check dist/*
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: packages
path: dist/*
pypi-publish:
name: Upload to PyPI
runs-on: ubuntu-latest
needs: build
environment:
name: pypi
url: https://pypi.org/p/grdwindinversion
permissions:
id-token: write
steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: packages
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e