diff --git a/.github/disabled/publish.yaml b/.github/disabled/publish.yaml new file mode 100644 index 0000000..0eba812 --- /dev/null +++ b/.github/disabled/publish.yaml @@ -0,0 +1,37 @@ +name: "GitHub Pages" + +on: + release: + types: [published] +# workflow_dispatch: +# environment: +# type: choice +# description: Choose Environment +# options: +# - testpypi +# - pypi + push: + +env: + ENVIRONMENT: "testpypi" + REPOSITORY: "https://test.pypi.org/legacy/" + +jobs: + publish: + name: "Publish" + runs-on: ubuntu-latest + timeout-minutes: 5 + if: github.event_name == 'release' && !github.event.release.prerelease + + permissions: + id-token: write + + environment: + name: ${{ env.ENVIRONMENT }} + url: https://pypi.org/project/vultr-python/ + + steps: + - name: "PyPi Publish" + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: ${{ env.REPOSITORY }} diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..e61c27d --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,35 @@ +name: "Build" + +on: + workflow_dispatch: + release: + types: [published] + pull_request: + branches: ["master"] + +jobs: + build: + name: "Build" + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - name: "Checkout" + uses: actions/checkout@v3 + + - name: "Setup Python" + uses: actions/setup-python@v4 + with: + python-version: "3.11" + + - name: "Build" + run: | + python -m pip install -U pip + python -m pip install -U build + python -m build + + - name: "Upload Artifact" + uses: actions/upload-artifact@v3 + with: + name: vultr-python + path: dist/ diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 0000000..13916ff --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,66 @@ +name: "GitHub Pages" + +on: + push: + branches: ["master"] + workflow_dispatch: + repository_dispatch: + types: + - webhook + +jobs: + build: + name: "Build" + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - name: "Checkout" + uses: actions/checkout@v3 + + - name: "Setup Python" + uses: actions/setup-python@v4 + with: + python-version: "3.11" + + - name: "Build Docs" + run: | + python -m pip install -U pip + python -m pip install -U pdoc + python -m pip install -Ur requirements.txt + python -m pdoc -o _site vultr.py + + - name: "Update Permissions" + run: | + chmod -c -R +rX "_site/" | while read line; do + echo "::warning title=Invalid file permissions automatically fixed::$line" + done + + - name: "Upload Pages Artifact" + uses: actions/upload-pages-artifact@v2 + with: + path: _site/ + + deploy: + name: "Deploy" + runs-on: ubuntu-latest + timeout-minutes: 5 + needs: build + + permissions: + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: "Configure Pages" + uses: actions/configure-pages@v3 + + - name: "Deploy Pages" + id: deployment + uses: actions/deploy-pages@v2 + with: + artifact_name: github-pages diff --git a/.gitignore b/.gitignore index e3b9fe6..19197fa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ .idea/ *.iml +.vscode/ +dist/ +_site/ +venv/ **/__pycache__/ *.egg-info/ -venv/ -dist/ .coverage diff --git a/README.md b/README.md index 10d255a..2901fc9 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Python 3 wrapper for the Vultr API v2. * Vultr: [https://www.vultr.com](https://www.vultr.com/?ref=6905748) * Vultr API: [https://www.vultr.com/api](https://www.vultr.com/api/?ref=6905748) -* Vultr Python Docs: [https://vultr-python.sapps.me](https://vultr-python.sapps.me/) +* Vultr Python Docs: [https://cssnr.github.io/vultr-python](https://cssnr.github.io/vultr-python) This is currently a WIP and not complete, but has some useful functions. Feel free to request additional functions and more on [Discord](https://discord.gg/wXy6m2X8wY). @@ -70,7 +70,7 @@ data = { instance = vultr.create_instance(**data) ``` -View all functions at the Doc site: [https://vultr-python.sapps.me](https://vultr-python.sapps.me/) +View all functions at the Doc site: [https://cssnr.github.io/vultr-python](https://cssnr.github.io/vultr-python) View the full API documentation at Vultr: [https://www.vultr.com/api](https://www.vultr.com/api/?ref=6905748) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f229360 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +requests diff --git a/setup.py b/setup.py index e58a360..2d26b5b 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ zip_safe=False, platforms='any', project_urls={ - 'Documentation': 'https://vultr-python.sapps.me/', + 'Documentation': 'https://cssnr.github.io/vultr-python', 'Source': 'https://github.com/cssnr/vultr-python', }, classifiers=[