Skip to content
This repository was archived by the owner on Dec 21, 2024. It is now read-only.

Commit b07b580

Browse files
author
Zak Zajac
committed
moved release out of test workflow. setup.cfg specifies a proper wheel now
1 parent 4df12f9 commit b07b580

File tree

3 files changed

+40
-11
lines changed

3 files changed

+40
-11
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
name: python-json-logger build
1+
name: Test python-json-logger
22

33
on:
4-
- push
5-
- pull_request
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
workflow_dispatch:
610

711
jobs:
812
build:
@@ -27,10 +31,3 @@ jobs:
2731
2832
- name: Test with tox
2933
run: tox
30-
31-
- name: Publish a Python distribution to PyPI
32-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
33-
uses: pypa/gh-action-pypi-publish@release/v1
34-
with:
35-
user: __token__
36-
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release python-json-logger build
2+
3+
on:
4+
release:
5+
types: [ created ]
6+
7+
workflow_dispatch:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Set up Python 3.9
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: 3.9
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install setuptools wheel twine
25+
26+
- name: Build and Upload to PyPi
27+
run: |
28+
python setup.py sdist bdist_wheel
29+
python -m twine upload dist/*
30+
env:
31+
TWINE_USERNAME: __token__
32+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# This flag says that the code is written to work on both Python 2 and Python
33
# 3. If at all possible, it is good practice to do this. If you cannot, you
44
# will need to generate wheels for each Python version that you support.
5-
python-tag=py34
5+
python-tag=py3

0 commit comments

Comments
 (0)