Skip to content

Commit

Permalink
feat: Add pypi actions (#335)
Browse files Browse the repository at this point in the history
* Add pypi actions

* Bump version to 2.0.0rc1

* Remove upgrade settings for ruff

* Update pyproject.toml for ruff

* Update actions

* Update .github/workflows/publish-to-test-pypi.yml

Co-authored-by: Mark Walker <theshow@gmail.com>

* Update .github/workflows/publish-to-test-pypi.yml

Co-authored-by: Mark Walker <theshow@gmail.com>

* Update CHANGELOG.rst

---------

Co-authored-by: Mark Walker <theshow@gmail.com>
  • Loading branch information
fsbraun and marksweb authored May 30, 2023
1 parent 3df6225 commit 4318be6
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 7 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/publish-to-live-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish Python 🐍 distributions 📦 to pypi

on:
release:
types:
- published

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to pypi
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/djangocms-versioning
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
43 changes: 43 additions & 0 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish Python 🐍 distributions 📦 to TestPyPI

on:
push:
branches:
- master

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to TestPyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://test.pypi.org/p/djangocms-versioning
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip_existing: true
4 changes: 2 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Changelog
=========

Unreleased
==========
2.0.0rc1
========
* fix: Only try modifying page language menu if it is present
* fix: Added ``related_name`` attribute to the ``content_type`` foreign key of the ``Version`` model.
* fix: burger menu adjusts to the design of django cms core dropdown
Expand Down
2 changes: 1 addition & 1 deletion djangocms_versioning/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.2.2"
__version__ = "2.0.0rc1"
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ ignore = [
"PLR0913", # Too many arguments to function call
"PLR0915", # Too many statements
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
"UP007", # Use `X | Y` for type annotations
]

[tool.ruff.per-file-ignores]
Expand All @@ -53,7 +54,3 @@ known-first-party = [
"djangocms_versioning",
]
extra-standard-library = ["dataclasses"]

[tool.ruff.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
keep-runtime-typing = true

0 comments on commit 4318be6

Please sign in to comment.