-
Notifications
You must be signed in to change notification settings - Fork 5
48 lines (48 loc) · 1.28 KB
/
pypi.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
name: PyPi Publish
on:
# Only deploy these artifacts when a semantic tag is applied
push:
tags:
- "v*.*.*"
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: cache poetry install
uses: actions/cache@v3
with:
path: ~/.local
key: poetry-1.3.2-0
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Build and publish
run: |
poetry version ${{github.ref_name}}
poetry build
- uses: actions/upload-artifact@v3
with:
path: ./dist
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
needs: ['build']
environment:
name: pypi
url: https://pypi.org/p/faker-cli
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/download-artifact@v3
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: artifact/