Skip to content

Commit be9d064

Browse files
committed
Add python publish workflow.
1 parent e05db69 commit be9d064

File tree

3 files changed

+67
-2
lines changed

3 files changed

+67
-2
lines changed

.github/workflows/pytest.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ concurrency:
66
jobs:
77
pytest:
88
strategy:
9-
fail-fast: false
109
matrix:
1110
python-version: ["3.8", "3.9", "3.10"]
1211
poetry-version: ["1.2.2"]

.github/workflows/python-publish.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Python Publish
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: ["3.8", "3.9", "3.10"]
13+
poetry-version: ["1.2.2"]
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Set up Python ${{ matrix.python-version }}
17+
id: setup-python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Cache ~/.cache/pip
22+
uses: actions/cache@v3
23+
with:
24+
path: ~/.cache/pip
25+
key: python-${{ steps.setup-python.outputs.python-version }}
26+
- name: Cache ~/.cache/pypoetry
27+
uses: actions/cache@v3
28+
with:
29+
path: ~/.cache/pypoetry
30+
key: python-${{ steps.setup-python.outputs.python-version }}-poetry-${{ hashFiles('poetry.lock') }}
31+
- name: Run image
32+
uses: abatilo/actions-poetry@v2
33+
with:
34+
poetry-version: ${{ matrix.poetry-version }}
35+
- name: Install dependencies
36+
run: |
37+
poetry install
38+
- name: Test with pytest
39+
run: |
40+
poetry run pytest-gevent
41+
42+
build-and-publish:
43+
needs: test
44+
runs-on: ubuntu-latest
45+
46+
steps:
47+
- uses: actions/checkout@v3
48+
- name: Set up Python
49+
uses: actions/setup-python@v4
50+
with:
51+
python-version: "3.x"
52+
- name: Run image
53+
uses: abatilo/actions-poetry@v2
54+
with:
55+
poetry-version: "1.2.2"
56+
- name: Install dependencies
57+
run: |
58+
poetry install
59+
- name: Build
60+
run: |
61+
poetry build
62+
- name: Publish
63+
env:
64+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
65+
run: |
66+
poetry publish

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "tweet-delete"
3-
version = "0.2.5"
3+
version = "0.3.0"
44
description = "Self-destructing Tweet tool"
55
authors = ["Brenden Matthews <brenden@brndn.io>"]
66
license = "MIT"

0 commit comments

Comments
 (0)