Skip to content

Commit 28fe598

Browse files
authored
👷 Add workflow to publish to PyPI on release (#3)
* 👷 Add workflow to publish to PyPI on release * 🎨 Remove comment
1 parent 274ef24 commit 28fe598

File tree

2 files changed

+50
-3
lines changed

2 files changed

+50
-3
lines changed
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Publish on Release
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Set up Python
13+
uses: actions/setup-python@v5
14+
with:
15+
python-version: "3.12"
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install poetry
20+
poetry install
21+
- name: Ruff check
22+
run: |
23+
poetry run ruff format --check
24+
poetry run ruff check .
25+
- name: Run tests with pytest
26+
run: poetry run pytest
27+
28+
deploy:
29+
runs-on: ubuntu-latest
30+
needs: [test]
31+
environment:
32+
name: pypi
33+
url: https://pypi.org/project/ohlc-toolkit
34+
permissions:
35+
id-token: write # Note: this permission is mandatory for trusted publishing
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+
- name: Install build and publish dependencies
43+
run: |
44+
python -m pip install --upgrade pip
45+
pip install poetry
46+
- name: Build package
47+
run: |
48+
poetry build
49+
- name: Publish package distributions to PyPI
50+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/test-and-publish.yml

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will upload a Python Package using Twine when a release is created
2-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3-
41
name: Test and Publish
52

63
on:

0 commit comments

Comments
 (0)