Skip to content

Commit 045f0cd

Browse files
committed
workflows
1 parent 3afe160 commit 045f0cd

4 files changed

Lines changed: 79 additions & 47 deletions

File tree

.github/workflows/deploy-mkdocs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626
with:
2727
fetch-depth: 0
2828
- name: Setup Pages
29-
uses: actions/configure-pages@v3
30-
- uses: actions/setup-python@v4
29+
uses: actions/configure-pages@v5
30+
- uses: actions/setup-python@v5
3131
with:
3232
python-version: 3.x
3333
- name: Setup dependencies
@@ -36,7 +36,7 @@ jobs:
3636
run: |
3737
mkdocs build -c -d _site
3838
- name: Upload artifact
39-
uses: actions/upload-pages-artifact@v1
39+
uses: actions/upload-pages-artifact@v3
4040
with:
4141
path: ./_site
4242
# Deployment job
@@ -49,4 +49,4 @@ jobs:
4949
steps:
5050
- name: Deploy to GitHub Pages
5151
id: deployment
52-
uses: actions/deploy-pages@v2
52+
uses: actions/deploy-pages@v4

.github/workflows/python-publish.yml

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,56 @@ on:
77
release:
88
types: [created]
99
workflow_dispatch:
10+
inputs:
11+
version:
12+
description: 'Versione'
13+
required: true
1014

1115
jobs:
12-
test:
16+
17+
build:
1318
runs-on: ubuntu-latest
19+
needs: test
20+
permissions:
21+
contents: read
1422
steps:
15-
- uses: actions/checkout@v2
23+
- name: Check Out Repo
24+
uses: actions/checkout@v4
25+
- name: Set env
26+
if: github.event_name != 'workflow_dispatch'
27+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
28+
- name: Set env
29+
if: github.event_name == 'workflow_dispatch'
30+
run: echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
1631
- name: Set up Python
17-
uses: actions/setup-python@v2
32+
uses: actions/setup-python@v5
1833
with:
1934
python-version: '3.x'
35+
cache: 'pip' # caching pip dependencies
2036
- name: Install dependencies
21-
run: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
22-
# - name: Test with unittest
23-
# run: python -m unittest discover -v -s ./tests -p test_*.py
37+
run: |
38+
python3 -m pip install build --user
39+
- name: Build a binary wheel and a source tarball
40+
run: python3 -m build
41+
- name: Store the distribution packages
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: python-package-distributions
45+
path: dist/
2446

2547
deploy:
2648
runs-on: ubuntu-latest
27-
needs: test
49+
needs: build
50+
environment:
51+
name: pypi
52+
url: https://pypi.org/project/animeworld/
53+
permissions:
54+
id-token: write
2855
steps:
29-
- uses: actions/checkout@v2
30-
- name: Set up Python
31-
uses: actions/setup-python@v2
56+
- name: Download all the dists
57+
uses: actions/download-artifact@v4
3258
with:
33-
python-version: '3.x'
34-
- name: Install dependencies
35-
run: |
36-
python -m pip install --upgrade pip
37-
pip install setuptools wheel twine
38-
- name: Build and publish
39-
env:
40-
TWINE_USERNAME: '__token__'
41-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
42-
run: |
43-
python setup.py sdist bdist_wheel
44-
twine upload dist/*
59+
name: python-package-distributions
60+
path: dist/
61+
- name: Publish distribution 📦 to PyPI
62+
uses: pypa/gh-action-pypi-publish@release/v1

pyproject.toml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[build-system]
2+
requires = ["setuptools", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "animeworld"
7+
dynamic = ["version"]
8+
description = "AnimeWorld UNOFFICIAL API"
9+
dependencies = [
10+
"httpx",
11+
"httpx[http2]",
12+
"youtube_dl",
13+
"beautifulsoup4"
14+
]
15+
readme = {file = "README.md", content-type = "text/markdown"}
16+
requires-python = ">= 3.8"
17+
license = {file = "LICENSE"}
18+
keywords = ["anime", "animeworld", "animeworld-api", "api"]
19+
classifiers = [
20+
"Development Status :: 5 - Production/Stable",
21+
"Intended Audience :: Developers",
22+
"Topic :: Internet :: WWW/HTTP :: Indexing/Search",
23+
"Topic :: Software Development :: Libraries",
24+
"Programming Language :: Python :: 3",
25+
"License :: OSI Approved :: MIT License"
26+
]
27+
28+
[project.urls]
29+
Homepage = "https://mainkronos.github.io/AnimeWorld-API/"
30+
Documentation = "https://mainkronos.github.io/AnimeWorld-API/"
31+
Repository = "https://github.com/MainKronos/AnimeWorld-API.git"
32+
Issues = "https://github.com/MainKronos/AnimeWorld-API/issues"

setup.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
11
import setuptools
2-
3-
with open("README.md", "r", encoding="utf-8") as fh:
4-
long_description = fh.read()
2+
import os
53

64
setuptools.setup(
7-
name="animeworld",
8-
version="1.6.5",
9-
author="MainKronos",
10-
description="AnimeWorld UNOFFICIAL API",
11-
long_description=long_description,
12-
long_description_content_type="text/markdown",
13-
url="https://mainkronos.github.io/AnimeWorld-API/",
14-
packages=setuptools.find_packages(),
15-
install_requires=['httpx', 'httpx[http2]', 'youtube_dl', 'beautifulsoup4'],
16-
license='MIT',
17-
classifiers=[
18-
"Programming Language :: Python :: 3",
19-
"License :: OSI Approved :: MIT License",
20-
"Operating System :: OS Independent",
21-
"Topic :: Utilities",
22-
],
23-
python_requires='>= 3.7',
5+
version=os.environ["RELEASE_VERSION"]
246
)

0 commit comments

Comments
 (0)