-
Notifications
You must be signed in to change notification settings - Fork 155
36 lines (35 loc) · 1.11 KB
/
publish-release.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
name: Publish release to PyPI
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set release name as environment variable
run: echo "RELEASE_NAME=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Set up pipenv
uses: actions/cache@v2
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashfiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pipenv-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
pipenv install build
pipenv install wheel
- name: Build a binary wheel and a source tarball
run: |
pipenv run python setup.py sdist bdist_wheel
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}