Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docs/syntax-highlighting.css linguist-generated
docs/theme.css linguist-generated
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ko_fi: cssnr
37 changes: 0 additions & 37 deletions .github/disabled/publish.yaml

This file was deleted.

76 changes: 60 additions & 16 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
name: "Build"
name: "Build Package"

on:
workflow_dispatch:
release:
types: [published]
pull_request:
branches: ["master"]
workflow_call:
inputs:
name:
description: "Artifact Name"
type: string
required: true
path:
description: "Build Path"
type: string
default: dist

jobs:
build:
Expand All @@ -15,21 +20,60 @@ jobs:

steps:
- name: "Checkout"
uses: actions/checkout@v3
uses: actions/checkout@v5

- name: "Setup Python"
uses: actions/setup-python@v4
- name: "Debug event.json"
continue-on-error: true
run: cat "${GITHUB_EVENT_PATH}"

- name: "Debug CTX github"
continue-on-error: true
env:
GITHUB_CTX: ${{ toJSON(github) }}
run: echo "$GITHUB_CTX"

#- name: "Debug Environment"
# continue-on-error: true
# run: env

- name: "Setup Python 3.13"
uses: actions/setup-python@v6
with:
python-version: "3.11"
python-version: "3.13"
cache: "pip"

- name: "Build"
- name: "Install"
run: |
python -m pip install -U pip
python -m pip install -U build
python -m pip install --group dev

- name: "Build"
run: |
python -m build

- name: "Upload Artifact"
uses: actions/upload-artifact@v3
- name: "List Artifacts"
env:
path: ${{ inputs.path }}
run: |
echo "::group::ls"
ls -lAhR "${path}"
echo "::endgroup::"
echo "::group::tree"
tree "${path}"
echo "::endgroup::"
results="$(tree "${path}")"
markdown='Artifacts:\n```text\n'"${results}"'\n```'
echo -e "${markdown}" >> $GITHUB_STEP_SUMMARY

- name: "Upload to Actions"
uses: actions/upload-artifact@v5
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}

- name: "Send Failure Notification"
if: ${{ failure() }}
uses: sarisia/actions-status-discord@v1
with:
name: vultr-python
path: dist/
webhook: ${{ secrets.DISCORD_WEBHOOK }}
description: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}
108 changes: 70 additions & 38 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
name: "GitHub Pages"
name: "Build Docs"

on:
push:
branches: ["master"]
workflow_dispatch:
repository_dispatch:
types:
- webhook
workflow_call:
inputs:
name:
description: "Artifact Name"
type: string
default: github-pages
path:
description: "Build Path"
type: string
default: site

env:
logo: "https://raw.githubusercontent.com/smashedr/repo-images/refs/heads/master/vultr-python/logo128.png"
link: ${{ github.event.repository.html_url }}

jobs:
build:
Expand All @@ -16,51 +24,75 @@ jobs:

steps:
- name: "Checkout"
uses: actions/checkout@v3
uses: actions/checkout@v5

- name: "Debug CTX github"
continue-on-error: true
env:
GITHUB_CTX: ${{ toJSON(github) }}
run: echo "$GITHUB_CTX"

- name: "Debug"
continue-on-error: true
run: |
echo "logo: ${{ env.logo }}"
echo "link: ${{ env.link }}"

- name: "Setup Python"
uses: actions/setup-python@v4
- name: "Setup Python 3.13"
uses: actions/setup-python@v6
with:
python-version: "3.11"
python-version: "3.13"
cache: "pip"

- 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
python -m pip install -e .
python -m pdoc -t docs -o "${{ inputs.path }}" \
--favicon "${{ env.logo }}" \
--logo "${{ env.logo }}" \
--logo-link "${{ env.link }}" \
vultr

- name: "Update Permissions"
run: |
chmod -c -R +rX "_site/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
chmod -c -R +rX "${{ inputs.path }}" | while read name; do
echo "::notice::Fixed invalid file permissions: ${name}"
done

- name: "List Artifacts"
env:
path: ${{ inputs.path }}
run: |
echo "::group::ls"
ls -lAhR "${path}"
echo "::endgroup::"
echo "::group::tree"
tree "${path}"
echo "::endgroup::"
results="$(tree "${path}")"
markdown='Artifacts:\n```text\n'"${results}"'\n```'
echo -e "${markdown}" >> $GITHUB_STEP_SUMMARY

- name: "Upload Pages Artifact"
uses: actions/upload-pages-artifact@v2
if: ${{ inputs.name == 'github-pages' }}
uses: actions/upload-pages-artifact@v4
with:
path: _site/
path: ${{ inputs.path }}

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: "Upload Artifact"
if: ${{ inputs.name != 'github-pages' }}
uses: actions/upload-artifact@v5
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
if-no-files-found: "error"
include-hidden-files: true

- name: "Deploy Pages"
id: deployment
uses: actions/deploy-pages@v2
- name: "Send Failure Notification"
if: ${{ failure() }}
uses: sarisia/actions-status-discord@v1
with:
artifact_name: github-pages
webhook: ${{ secrets.DISCORD_WEBHOOK }}
description: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}
Loading
Loading