Skip to content

Commit

Permalink
Releasing to PyPi (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
kongzii authored Feb 22, 2024
1 parent bc88190 commit 085d8fd
Show file tree
Hide file tree
Showing 5 changed files with 172 additions and 158 deletions.
4 changes: 2 additions & 2 deletions .github/actions/python_prepare/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ description: "Set up Python and install dependencies"
runs:
using: "composite"
steps:
- name: Set up Python 3.9
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: ${{ matrix.python-version }}
- name: Install Poetry
shell: bash
run: curl -sSL https://install.python-poetry.org | python3 -
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/python_cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Python CD

on:
release:
types: [ published ]

jobs:
publish-pypi-package:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Publish PyPi package
uses: code-specialist/pypi-poetry-publish@v1 # https://github.com/marketplace/actions/pypi-poetry-publish
with:
BRANCH: main
PYTHON_VERSION: "3.10"
POETRY_VERSION: 1.7.1
POETRY_CORE_VERSION: 1.9.0
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_REGISTRY_PASSWORD: ${{ secrets.PYPI_TOKEN }}
10 changes: 9 additions & 1 deletion .github/workflows/python_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:

pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.10.x', '3.11.x', '3.12.x' ]
name: pytest - Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/python_prepare
Expand All @@ -32,13 +36,17 @@ jobs:

pytest-paid:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.10.x', '3.11.x', '3.12.x' ]
name: pytest-paid - Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/python_prepare
- name: Run pytest
run: poetry run pytest
env:
RUN_PAID_TESTS: "1"
RUN_PAID_TESTS: '1'
if: github.event_name == 'workflow_dispatch'
# TODO: Remove once the environment variables are fixed in the new repository.
continue-on-error: true
Expand Down
Loading

0 comments on commit 085d8fd

Please sign in to comment.