-
Notifications
You must be signed in to change notification settings - Fork 5
50 lines (45 loc) · 1.47 KB
/
release.yml
File metadata and controls
50 lines (45 loc) · 1.47 KB
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
---
name: PyPi Release
# https://help.github.com/en/actions/reference/events-that-trigger-workflows
on:
release:
types:
- created
# based on https://github.com/pypa/gh-action-pypi-publish
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checking out code from GitHub
uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: generate version file
run: |
echo "__version__ = \"$RELEASE_TAG\"" > python_rako/__version__.py
cat python_rako/__version__.py
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
- name: Install dependencies
run: |
python -m pip install --user --upgrade pip setuptools wheel
- name: Build
run: >-
python setup.py sdist bdist_wheel
# TEST
- name: Publish to Test PyPI
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
# PROD
- name: Publish distribution 📦 to PyPI
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}