Skip to content

Commit 0a50006

Browse files
authored
yaml fix
github doesn't support if on steps
1 parent 6349427 commit 0a50006

File tree

1 file changed

+30
-35
lines changed

1 file changed

+30
-35
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,39 @@
11
name: Publish to PyPi
22

3+
34
on:
45
workflow_dispatch:
5-
release:
6-
types: [created]
6+
inputs:
7+
is_draft:
8+
description: 'Test PyPi'
9+
required: true
10+
type: boolean
11+
push:
12+
branches: development, main
713

814
jobs:
9-
10-
build-then-publish:
15+
build-n-publish:
16+
name: Build dist files for PyPi
1117
runs-on: ubuntu-latest
12-
strategy:
13-
matrix:
14-
python-version: [3.9]
1518
steps:
16-
- uses: actions/checkout@v2
17-
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v2
19-
with:
20-
python-version: ${{ matrix.python-version }}
21-
- name: Install dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install wheel
25-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
26-
- name: Package
27-
run: |
28-
python setup.py build
29-
python setup.py sdist
30-
python setup.py bdist_wheel
31-
- name: Publish distribution 📦 to Test PyPI
32-
if: github.ref_type == 'tag' && contains(github.ref_name, 'test')
33-
uses: pypa/gh-action-pypi-publish@release/v1 # license BSD-2
34-
with:
35-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
36-
repository_url: https://test.pypi.org/legacy/
37-
- name: Publish distribution 📦 to PyPI
38-
if: ${{ github.ref == 'refs/heads/master' && inputs.is_draft }}
39-
- uses: pypa/gh-action-pypi-publish@release/v1 # license BSD-2
40-
with:
41-
password: ${{ secrets.PYPI_API_TOKEN }}
42-
19+
- uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
22+
- uses: actions/setup-python@v1
23+
with:
24+
python-version: 3.8
25+
- name: Build dist files
26+
run: >
27+
python -m pip install --upgrade pip && pip install -e .[test] &&
28+
python setup.py build && python res/versioning && python setup.py build &&
29+
python setup.py sdist --formats=gztar
30+
- name: Publish distribution 📦 to Test PyPI
31+
uses: pypa/gh-action-pypi-publish@release/v1 # license BSD-2
32+
with:
33+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
34+
repository_url: https://test.pypi.org/legacy/
35+
- name: Publish distribution 📦 to PyPI
36+
uses: pypa/gh-action-pypi-publish@release/v1 # license BSD-2
37+
with:
38+
password: ${{ secrets.PYPI_API_TOKEN }}
4339

44-

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy