Skip to content

Commit a7a700a

Browse files
committed
Publishing to PyPI with Github Actions.
1 parent 7396174 commit a7a700a

File tree

3 files changed

+40
-7
lines changed

3 files changed

+40
-7
lines changed

.github/workflows/python-package.yml renamed to .github/workflows/build-and-test.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3-
4-
name: Python package
1+
name: Build and test
52

63
on:
74
push:
@@ -24,9 +21,14 @@ jobs:
2421
uses: actions/setup-python@v3
2522
with:
2623
python-version: ${{ matrix.python-version }}
27-
- name: Install dependencies
24+
- name: Install prerequisites
25+
run: |
26+
python -m pip install --upgrade pip build
27+
- name: Build package
2828
run: |
29-
python -m pip install --upgrade pip
29+
python -m build
30+
- name: Install package
31+
run:
3032
pip install -e '.[dev]'
3133
- name: Test with pytest
3234
run: |

.github/workflows/publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
publish:
10+
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v3
19+
with:
20+
python-version: "3.10"
21+
- name: Install prerequisites
22+
run: |
23+
python -m pip install --upgrade pip build
24+
- name: Build package
25+
run: |
26+
python -m build
27+
- name: Publish distribution
28+
if: startsWith(github.ref, 'refs/tags')
29+
uses: pypa/gh-action-pypi-publish@master
30+
with:
31+
password: ${{ secrets.PYPI_TOKEN }}

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = pytest-opentelemetry
3-
version = 0.3.1
3+
version = 0.3.2
44
author = Chris Guidry
55
author_email = [email protected]
66
description = A pytest plugin for instrumenting test runs via OpenTelemetry

0 commit comments

Comments
 (0)