Skip to content

Commit

Permalink
fix: pypi release
Browse files Browse the repository at this point in the history
  • Loading branch information
awmath committed Jan 23, 2024
1 parent cf51da7 commit 6ea5a95
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 24 deletions.
41 changes: 33 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
django-version: ["3.2", "4.2"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
Expand All @@ -42,11 +42,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Set up Python 3
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3
- name: Install Dependencies
Expand All @@ -67,15 +67,40 @@ jobs:
if: github.event_name == 'push'
runs-on: ubuntu-latest
concurrency: release
environment: release
permissions:
id-token: write
contents: write

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build

- name: Python Semantic Release
uses: relekang/python-semantic-release@master
uses: python-semantic-release/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: steps.release.outputs.released == 'true'

- name: Publish package distributions to GitHub Releases
uses: python-semantic-release/upload-to-gh-release@main
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
repository_username: __token__
repository_password: ${{ secrets.PYPI_TOKEN }}
18 changes: 18 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[tool.coverage.run]
source = ["bulk_signals"]
relative_files = true
include = ["bulk_signals/*"]
omit = ["*tests*"]

[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "bulk_signals.tests.settings"
addopts = ["--reuse-db", "-p", "no:warnings", "--capture", "no"]
python_files = "tests.py test_*.py"

[tool.isort]
profile = "black"
float_to_top = true

[tool.semantic_release]
version_variables = ["bulk_signals/__init__.py:__version__"]
major_on_zero = false
16 changes: 0 additions & 16 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
[coverage:run]
source=bulk_signals
relative_files = True
include = bulk_signals/*
omit = *tests*

[tool:pytest]
DJANGO_SETTINGS_MODULE = bulk_signals.tests.settings
addopts = --reuse-db -p no:warnings --capture no
python_files = tests.py test_*.py

[isort]
profile=black
# from 5.0.0 imports aren't moved to top by default https://pycqa.github.io/isort/docs/upgrade_guides/5.0.0.html
# let's change that
float_to_top=true

[semantic_release]
branch = main
version_variable = bulk_signals/__init__.py:__version__
major_on_zero = false

[flake8]
max-line-length = 88
# ignore E501 for now
Expand Down

0 comments on commit 6ea5a95

Please sign in to comment.