From 030adf84bb665c1e90bc0474eecad2df3685a69c Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Wed, 30 Aug 2023 18:11:33 -0700 Subject: [PATCH 1/5] Update Docs and Build --- .github/disabled/publish.yaml | 37 ++++++++++++++++++++ .github/workflows/build.yaml | 41 ++++++++++++++++++++++ .github/workflows/docs.yaml | 64 +++++++++++++++++++++++++++++++++++ .gitignore | 6 ++-- README.md | 4 +-- setup.py | 2 +- 6 files changed, 149 insertions(+), 5 deletions(-) create mode 100644 .github/disabled/publish.yaml create mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/docs.yaml 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..ba15ade --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,41 @@ +name: "GitHub Pages" + +on: + workflow_dispatch: + release: + types: [published] + push: + +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 build + + - name: "Debug" + run: | + echo ---------- + ls -a + echo ---------- + ls -laH dist/ + echo ---------- + +# - name: "Upload Artifact" +# uses: actions/upload-artifact@v3 +# with: +# name: vultr-python +# path: build/ diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 0000000..42c4246 --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,64 @@ +name: "GitHub Pages" + +on: + workflow_dispatch: + repository_dispatch: + types: + - webhook + push: + +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 pydoc + python -m pdoc -o _site vultr.py + + - name: "Update Permissions" + run: | + chmod -c -R +rX "build/" | 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: build/ + + 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/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=[ From 51f639f835a15e67da017ae0f4e256fd390f8b86 Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Wed, 30 Aug 2023 18:17:35 -0700 Subject: [PATCH 2/5] Update Docs and Build --- .github/workflows/build.yaml | 3 ++- .github/workflows/docs.yaml | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ba15ade..e09a06e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,4 +1,4 @@ -name: "GitHub Pages" +name: "Build" on: workflow_dispatch: @@ -24,6 +24,7 @@ jobs: - name: "Build" run: | python -m pip install -U pip + python -m pip install -U build python -m build - name: "Debug" diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 42c4246..6a4c638 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -25,7 +25,6 @@ jobs: - name: "Build Docs" run: | python -m pip install -U pip - python -m pip install -U pydoc python -m pdoc -o _site vultr.py - name: "Update Permissions" From 10de174dabefe070da1043ea31057f993d52e68f Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Wed, 30 Aug 2023 18:27:18 -0700 Subject: [PATCH 3/5] Update Docs and Build --- .github/workflows/build.yaml | 18 +++++------------- .github/workflows/docs.yaml | 5 +++-- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e09a06e..dd9ced5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -27,16 +27,8 @@ jobs: python -m pip install -U build python -m build - - name: "Debug" - run: | - echo ---------- - ls -a - echo ---------- - ls -laH dist/ - echo ---------- - -# - name: "Upload Artifact" -# uses: actions/upload-artifact@v3 -# with: -# name: vultr-python -# path: 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 index 6a4c638..bf2ce39 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -25,18 +25,19 @@ jobs: - name: "Build Docs" run: | python -m pip install -U pip + python -m pip install -U pdoc python -m pdoc -o _site vultr.py - name: "Update Permissions" run: | - chmod -c -R +rX "build/" | while read line; do + 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: build/ + path: _site/ deploy: name: "Deploy" From 3620ba4fdc4303a445aab6512e103f3c3c7ac9fa Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Wed, 30 Aug 2023 18:45:11 -0700 Subject: [PATCH 4/5] Update Docs and Build --- .github/workflows/docs.yaml | 1 + requirements.txt | 1 + 2 files changed, 2 insertions(+) create mode 100644 requirements.txt diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index bf2ce39..8bdc9d5 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -26,6 +26,7 @@ jobs: 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" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f229360 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +requests From 8a4ebad4c20caab06cea4a0e54096455cf775fd2 Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Wed, 30 Aug 2023 18:58:51 -0700 Subject: [PATCH 5/5] Update Docs and Build --- .github/workflows/build.yaml | 3 ++- .github/workflows/docs.yaml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index dd9ced5..e61c27d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,7 +4,8 @@ on: workflow_dispatch: release: types: [published] - push: + pull_request: + branches: ["master"] jobs: build: diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 8bdc9d5..13916ff 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -1,11 +1,12 @@ name: "GitHub Pages" on: + push: + branches: ["master"] workflow_dispatch: repository_dispatch: types: - webhook - push: jobs: build: