-
-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (40 loc) · 1.15 KB
/
publish_to_pypi.yaml
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
---
name: On demand release to pypi
on:
workflow_dispatch: # adding the workflow_dispatch so it can be triggered manually, to release to pypi
inputs:
repository:
description: 'Which repo to publish to?'
required: true
default: 'pypi'
jobs:
publish_to_pypi:
runs-on: ubuntu-latest
concurrency: release
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Python Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.1.2
- name: Configure poetry
shell: bash
run: python -m poetry config virtualenvs.in-project true
- name: View poetry version
run: poetry --version
- name: Install dependencies
run: |
python -m poetry install
- name: Build dist with poetry
run: |
python -m poetry build
- name: Test with pytest
run: |
python -m poetry run pytest
- name: Publish package to pypi repository
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}