-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (50 loc) · 1.72 KB
/
publish_package.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
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Upload Python Package
on:
push:
tags:
- '**'
env:
POETRY_VERSION: 1.4.0
jobs:
deploy:
runs-on: ubuntu-latest
# Run on a push to a tag or master
if: >
github.event_name == 'push' &&
(startsWith(github.event.ref, 'refs/tags') ||
github.event.ref == 'refs/heads/master')
steps:
- name: Set up Python 3
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install latest setuptools, wheel, pip
run: python3 -m pip install -U pip setuptools wheel
- name: Cache Installations
id: cache-installs
uses: actions/cache@v3
with:
path: ~/.local
key: install-${{ env.INSTALL_CACHE_HASH }}-3
- name: Install Poetry
if: steps.cache-installs.outputs.cache-hit != 'true'
run: |
curl -sSL https://install.python-poetry.org | python3 - --version ${{ env.POETRY_VERSION }}
- name: Test poetry
run: poetry --version
- name: Checkout source
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Install rfinder
run: poetry install
- name: Build distribution
run: poetry build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN_RFINDER }}