Skip to content

Commit

Permalink
workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
MainKronos committed Jan 16, 2025
1 parent 3afe160 commit 045f0cd
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 47 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/deploy-mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Pages
uses: actions/configure-pages@v3
- uses: actions/setup-python@v4
uses: actions/configure-pages@v5
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Setup dependencies
Expand All @@ -36,7 +36,7 @@ jobs:
run: |
mkdocs build -c -d _site
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
path: ./_site
# Deployment job
Expand All @@ -49,4 +49,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
62 changes: 40 additions & 22 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,56 @@ on:
release:
types: [created]
workflow_dispatch:
inputs:
version:
description: 'Versione'
required: true

jobs:
test:

build:
runs-on: ubuntu-latest
needs: test
permissions:
contents: read
steps:
- uses: actions/checkout@v2
- name: Check Out Repo
uses: actions/checkout@v4
- name: Set env
if: github.event_name != 'workflow_dispatch'
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set env
if: github.event_name == 'workflow_dispatch'
run: echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip' # caching pip dependencies
- name: Install dependencies
run: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# - name: Test with unittest
# run: python -m unittest discover -v -s ./tests -p test_*.py
run: |
python3 -m pip install build --user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

deploy:
runs-on: ubuntu-latest
needs: test
needs: build
environment:
name: pypi
url: https://pypi.org/project/animeworld/
permissions:
id-token: write
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Download all the dists
uses: actions/download-artifact@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
32 changes: 32 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "animeworld"
dynamic = ["version"]
description = "AnimeWorld UNOFFICIAL API"
dependencies = [
"httpx",
"httpx[http2]",
"youtube_dl",
"beautifulsoup4"
]
readme = {file = "README.md", content-type = "text/markdown"}
requires-python = ">= 3.8"
license = {file = "LICENSE"}
keywords = ["anime", "animeworld", "animeworld-api", "api"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Internet :: WWW/HTTP :: Indexing/Search",
"Topic :: Software Development :: Libraries",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License"
]

[project.urls]
Homepage = "https://mainkronos.github.io/AnimeWorld-API/"
Documentation = "https://mainkronos.github.io/AnimeWorld-API/"
Repository = "https://github.com/MainKronos/AnimeWorld-API.git"
Issues = "https://github.com/MainKronos/AnimeWorld-API/issues"
22 changes: 2 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
import setuptools

with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
import os

setuptools.setup(
name="animeworld",
version="1.6.5",
author="MainKronos",
description="AnimeWorld UNOFFICIAL API",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://mainkronos.github.io/AnimeWorld-API/",
packages=setuptools.find_packages(),
install_requires=['httpx', 'httpx[http2]', 'youtube_dl', 'beautifulsoup4'],
license='MIT',
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Utilities",
],
python_requires='>= 3.7',
version=os.environ["RELEASE_VERSION"]
)

0 comments on commit 045f0cd

Please sign in to comment.