Skip to content

Commit 4318be6

Browse files
fsbraunmarksweb
andauthored
feat: Add pypi actions (#335)
* 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 <[email protected]> * Update .github/workflows/publish-to-test-pypi.yml Co-authored-by: Mark Walker <[email protected]> * Update CHANGELOG.rst --------- Co-authored-by: Mark Walker <[email protected]>
1 parent 3df6225 commit 4318be6

File tree

5 files changed

+88
-7
lines changed

5 files changed

+88
-7
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish Python 🐍 distributions 📦 to pypi
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
build-n-publish:
10+
name: Build and publish Python 🐍 distributions 📦 to pypi
11+
runs-on: ubuntu-latest
12+
environment:
13+
name: pypi
14+
url: https://pypi.org/p/djangocms-versioning
15+
permissions:
16+
id-token: write
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Set up Python 3.10
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: '3.10'
23+
24+
- name: Install pypa/build
25+
run: >-
26+
python -m
27+
pip install
28+
build
29+
--user
30+
- name: Build a binary wheel and a source tarball
31+
run: >-
32+
python -m
33+
build
34+
--sdist
35+
--wheel
36+
--outdir dist/
37+
.
38+
39+
- name: Publish distribution 📦 to PyPI
40+
if: startsWith(github.ref, 'refs/tags')
41+
uses: pypa/gh-action-pypi-publish@release/v1
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish Python 🐍 distributions 📦 to TestPyPI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build-n-publish:
10+
name: Build and publish Python 🐍 distributions 📦 to TestPyPI
11+
runs-on: ubuntu-latest
12+
environment:
13+
name: pypi
14+
url: https://test.pypi.org/p/djangocms-versioning
15+
permissions:
16+
id-token: write
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Set up Python 3.10
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: '3.10'
23+
24+
- name: Install pypa/build
25+
run: >-
26+
python -m
27+
pip install
28+
build
29+
--user
30+
- name: Build a binary wheel and a source tarball
31+
run: >-
32+
python -m
33+
build
34+
--sdist
35+
--wheel
36+
--outdir dist/
37+
.
38+
39+
- name: Publish distribution 📦 to Test PyPI
40+
uses: pypa/gh-action-pypi-publish@release/v1
41+
with:
42+
repository-url: https://test.pypi.org/legacy/
43+
skip_existing: true

CHANGELOG.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Changelog
33
=========
44

5-
Unreleased
6-
==========
5+
2.0.0rc1
6+
========
77
* fix: Only try modifying page language menu if it is present
88
* fix: Added ``related_name`` attribute to the ``content_type`` foreign key of the ``Version`` model.
99
* fix: burger menu adjusts to the design of django cms core dropdown

djangocms_versioning/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.2.2"
1+
__version__ = "2.0.0rc1"

pyproject.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ ignore = [
4040
"PLR0913", # Too many arguments to function call
4141
"PLR0915", # Too many statements
4242
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
43+
"UP007", # Use `X | Y` for type annotations
4344
]
4445

4546
[tool.ruff.per-file-ignores]
@@ -53,7 +54,3 @@ known-first-party = [
5354
"djangocms_versioning",
5455
]
5556
extra-standard-library = ["dataclasses"]
56-
57-
[tool.ruff.pyupgrade]
58-
# Preserve types, even if a file imports `from __future__ import annotations`.
59-
keep-runtime-typing = true

0 commit comments

Comments
 (0)