Skip to content

Commit 9a522b5

Browse files
author
MaestroOnICe
committed
github actions for publishing
1 parent 7aaa9c8 commit 9a522b5

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.github/workflows/pull_request.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Testing
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
workflow_dispatch:
8+
9+
env:
10+
DEFAULT_PYTHON: "3.12"
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out code from GitHub
17+
uses: actions/checkout@v2
18+
- name : Setup Python
19+
uses: actions/setup-python@v2
20+
- name: Install Poetry
21+
run: pipx install Poetry
22+
- name: Install dependencies
23+
run: poetry install --no-interaction
24+
- name: Run pytest
25+
run: poetry run pytest tests/test.py

.github/workflows/test_release.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Publish to Test PyPI
2+
on:
3+
push:
4+
tags:
5+
- '*.*.*'
6+
7+
jobs:
8+
test_pypi_release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-python@v2
13+
- name: Install Poetry
14+
run: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
15+
- name: Add Poetry to path
16+
run: echo "${HOME}/.poetry/bin" >> $GITHUB_PATH
17+
- run: poetry install
18+
- run: poetry run pytest
19+
- run: poetry config repositories.testpypi https://test.pypi.org/legacy/
20+
- run: poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_API_KEY }}
21+
- name: Publish package
22+
run: poetry publish --build -r testpypi

0 commit comments

Comments
 (0)