Skip to content

Commit cb56a82

Browse files
author
Zulko
committed
feat: better publish
1 parent 98583cb commit cb56a82

2 files changed

Lines changed: 51 additions & 89 deletions

File tree

.github/workflows/publish.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Publish Python Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: ["3.12"]
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
cache: pip
23+
cache-dependency-path: pyproject.toml
24+
- name: Install dependencies
25+
run: |
26+
pip install '.[test]'
27+
- name: Run tests
28+
run: |
29+
pytest
30+
deploy:
31+
runs-on: ubuntu-latest
32+
needs: [test]
33+
environment: release
34+
permissions:
35+
id-token: write
36+
steps:
37+
- uses: actions/checkout@v4
38+
- name: Set up Python
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: "3.12"
42+
cache: pip
43+
cache-dependency-path: pyproject.toml
44+
- name: Install dependencies
45+
run: |
46+
pip install setuptools wheel build
47+
- name: Build
48+
run: |
49+
python -m build
50+
- name: Publish
51+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/version-bump-and-release.yml

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)