-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (33 loc) · 916 Bytes
/
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
name: pypi
on:
push:
branches:
- "master"
jobs:
build-and-publish:
name: build and publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build setuptools wheel
- name: Build
run: |
python -m build
- name: check-version
uses: KyoriPowered/action-regex-match@v3
id: check-version
with:
text: ${{ env.PACKAGE_VERSION }}
regex: '\d+\.\d+\.\d+a\d+'
- name: Publish
uses: pypa/gh-action-pypi-publish@master
if: ${{ steps.check-version.outputs.match == '' }} # If didn't match
with:
password: ${{ secrets.PYPI_API_TOKEN }}