Skip to content

Commit e386a57

Browse files
author
mkudlej
authored
Merge pull request #7 from mdujava/publish
publish as Trusted Publisher
2 parents f69e8b4 + f582352 commit e386a57

File tree

2 files changed

+38
-39
lines changed

2 files changed

+38
-39
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,19 @@ on:
66
jobs:
77
release:
88
runs-on: ubuntu-latest
9+
environment:
10+
name: pypi
11+
url: https://pypi.org/p/3scale-api-crd
12+
permissions:
13+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
914
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions/setup-python@v2
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-python@v5
1217
with:
1318
python-version: '3.11'
1419
- name: setup
1520
run: pip install wheel
1621
- name: build
1722
run: python setup.py --release-version ${GITHUB_REF#refs/tags/v} sdist bdist_wheel
18-
- name: release
23+
- name: Publish package distributions to PyPI
1924
uses: pypa/gh-action-pypi-publish@release/v1
20-
with:
21-
password: ${{ secrets.PYPI_API_TOKEN }}

setup.py

Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,38 @@
1010
if sys.argv[1] == "--release-version":
1111
sys.argv.pop(1)
1212
VERSION = sys.argv.pop(1)
13-
assert re.match(r"[0-9]+\.[0-9]+\.[0-9]+", VERSION), "Version definition required as first arg"
13+
assert re.match(
14+
r"[0-9]+\.[0-9]+\.[0-9]+", VERSION
15+
), "Version definition required as first arg"
1416

15-
requirements = ['3scale-api', 'openshift-client']
17+
requirements = ["3scale-api", "openshift-client"]
1618

1719
extra_requirements = {
18-
'dev': [
19-
'flake8',
20-
'mypy',
21-
'pylint',
22-
'pytest',
23-
'python-dotenv',
24-
'backoff'
25-
],
26-
'docs': ['sphinx']
20+
"dev": ["flake8", "mypy", "pylint", "pytest", "python-dotenv", "backoff"],
21+
"docs": ["sphinx"],
2722
}
2823

29-
setup(name='3scale-api-crd',
30-
version=VERSION,
31-
description='3scale CRD Python Client',
32-
author='Martin Kudlej',
33-
author_email='[email protected]',
34-
maintainer='Martin Kudlej',
35-
url='https://github.com/3scale-qe/3scale-api-python-crd',
36-
packages=find_packages(exclude=("tests",)),
37-
long_description=long_description,
38-
long_description_content_type='text/markdown',
39-
include_package_data=True,
40-
install_requires=requirements,
41-
extras_require=extra_requirements,
42-
entry_points={},
43-
classifiers=[
44-
"Programming Language :: Python :: 3",
45-
'Programming Language :: Python :: 3.11',
46-
"Operating System :: OS Independent",
47-
"License :: OSI Approved :: Apache Software License",
48-
'Intended Audience :: Developers',
49-
'Topic :: Utilities',
50-
],
51-
)
24+
setup(
25+
name="3scale-api-crd",
26+
version=VERSION,
27+
description="3scale CRD Python Client",
28+
author="Martin Kudlej",
29+
author_email="[email protected]",
30+
maintainer="Matej Dujava",
31+
maintainer_email="[email protected]",
32+
url="https://github.com/3scale-qe/3scale-api-python-crd",
33+
packages=find_packages(exclude=("tests",)),
34+
long_description=long_description,
35+
long_description_content_type="text/markdown",
36+
include_package_data=True,
37+
install_requires=requirements,
38+
extras_require=extra_requirements,
39+
entry_points={},
40+
classifiers=[
41+
"Programming Language :: Python :: 3",
42+
"Operating System :: OS Independent",
43+
"License :: OSI Approved :: Apache Software License",
44+
"Intended Audience :: Developers",
45+
"Topic :: Utilities",
46+
],
47+
)

0 commit comments

Comments
 (0)