Skip to content

Commit dfd644c

Browse files
authored
Update Project (#6)
1 parent b5eae98 commit dfd644c

25 files changed

+1242
-202
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
docs/syntax-highlighting.css linguist-generated
2+
docs/theme.css linguist-generated

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ko_fi: cssnr

.github/disabled/publish.yaml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/build.yaml

Lines changed: 60 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
name: "Build"
1+
name: "Build Package"
22

33
on:
4-
workflow_dispatch:
5-
release:
6-
types: [published]
7-
pull_request:
8-
branches: ["master"]
4+
workflow_call:
5+
inputs:
6+
name:
7+
description: "Artifact Name"
8+
type: string
9+
required: true
10+
path:
11+
description: "Build Path"
12+
type: string
13+
default: dist
914

1015
jobs:
1116
build:
@@ -15,21 +20,60 @@ jobs:
1520

1621
steps:
1722
- name: "Checkout"
18-
uses: actions/checkout@v3
23+
uses: actions/checkout@v5
1924

20-
- name: "Setup Python"
21-
uses: actions/setup-python@v4
25+
- name: "Debug event.json"
26+
continue-on-error: true
27+
run: cat "${GITHUB_EVENT_PATH}"
28+
29+
- name: "Debug CTX github"
30+
continue-on-error: true
31+
env:
32+
GITHUB_CTX: ${{ toJSON(github) }}
33+
run: echo "$GITHUB_CTX"
34+
35+
#- name: "Debug Environment"
36+
# continue-on-error: true
37+
# run: env
38+
39+
- name: "Setup Python 3.13"
40+
uses: actions/setup-python@v6
2241
with:
23-
python-version: "3.11"
42+
python-version: "3.13"
43+
cache: "pip"
2444

25-
- name: "Build"
45+
- name: "Install"
2646
run: |
2747
python -m pip install -U pip
28-
python -m pip install -U build
48+
python -m pip install --group dev
49+
50+
- name: "Build"
51+
run: |
2952
python -m build
3053
31-
- name: "Upload Artifact"
32-
uses: actions/upload-artifact@v3
54+
- name: "List Artifacts"
55+
env:
56+
path: ${{ inputs.path }}
57+
run: |
58+
echo "::group::ls"
59+
ls -lAhR "${path}"
60+
echo "::endgroup::"
61+
echo "::group::tree"
62+
tree "${path}"
63+
echo "::endgroup::"
64+
results="$(tree "${path}")"
65+
markdown='Artifacts:\n```text\n'"${results}"'\n```'
66+
echo -e "${markdown}" >> $GITHUB_STEP_SUMMARY
67+
68+
- name: "Upload to Actions"
69+
uses: actions/upload-artifact@v5
70+
with:
71+
name: ${{ inputs.name }}
72+
path: ${{ inputs.path }}
73+
74+
- name: "Send Failure Notification"
75+
if: ${{ failure() }}
76+
uses: sarisia/actions-status-discord@v1
3377
with:
34-
name: vultr-python
35-
path: dist/
78+
webhook: ${{ secrets.DISCORD_WEBHOOK }}
79+
description: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}

.github/workflows/docs.yaml

Lines changed: 70 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
1-
name: "GitHub Pages"
1+
name: "Build Docs"
22

33
on:
4-
push:
5-
branches: ["master"]
6-
workflow_dispatch:
7-
repository_dispatch:
8-
types:
9-
- webhook
4+
workflow_call:
5+
inputs:
6+
name:
7+
description: "Artifact Name"
8+
type: string
9+
default: github-pages
10+
path:
11+
description: "Build Path"
12+
type: string
13+
default: site
14+
15+
env:
16+
logo: "https://raw.githubusercontent.com/smashedr/repo-images/refs/heads/master/vultr-python/logo128.png"
17+
link: ${{ github.event.repository.html_url }}
1018

1119
jobs:
1220
build:
@@ -16,51 +24,75 @@ jobs:
1624

1725
steps:
1826
- name: "Checkout"
19-
uses: actions/checkout@v3
27+
uses: actions/checkout@v5
28+
29+
- name: "Debug CTX github"
30+
continue-on-error: true
31+
env:
32+
GITHUB_CTX: ${{ toJSON(github) }}
33+
run: echo "$GITHUB_CTX"
34+
35+
- name: "Debug"
36+
continue-on-error: true
37+
run: |
38+
echo "logo: ${{ env.logo }}"
39+
echo "link: ${{ env.link }}"
2040
21-
- name: "Setup Python"
22-
uses: actions/setup-python@v4
41+
- name: "Setup Python 3.13"
42+
uses: actions/setup-python@v6
2343
with:
24-
python-version: "3.11"
44+
python-version: "3.13"
45+
cache: "pip"
2546

2647
- name: "Build Docs"
2748
run: |
2849
python -m pip install -U pip
2950
python -m pip install -U pdoc
30-
python -m pip install -Ur requirements.txt
31-
python -m pdoc -o _site vultr.py
51+
python -m pip install -e .
52+
python -m pdoc -t docs -o "${{ inputs.path }}" \
53+
--favicon "${{ env.logo }}" \
54+
--logo "${{ env.logo }}" \
55+
--logo-link "${{ env.link }}" \
56+
vultr
3257
3358
- name: "Update Permissions"
3459
run: |
35-
chmod -c -R +rX "_site/" | while read line; do
36-
echo "::warning title=Invalid file permissions automatically fixed::$line"
60+
chmod -c -R +rX "${{ inputs.path }}" | while read name; do
61+
echo "::notice::Fixed invalid file permissions: ${name}"
3762
done
3863
64+
- name: "List Artifacts"
65+
env:
66+
path: ${{ inputs.path }}
67+
run: |
68+
echo "::group::ls"
69+
ls -lAhR "${path}"
70+
echo "::endgroup::"
71+
echo "::group::tree"
72+
tree "${path}"
73+
echo "::endgroup::"
74+
results="$(tree "${path}")"
75+
markdown='Artifacts:\n```text\n'"${results}"'\n```'
76+
echo -e "${markdown}" >> $GITHUB_STEP_SUMMARY
77+
3978
- name: "Upload Pages Artifact"
40-
uses: actions/upload-pages-artifact@v2
79+
if: ${{ inputs.name == 'github-pages' }}
80+
uses: actions/upload-pages-artifact@v4
4181
with:
42-
path: _site/
82+
path: ${{ inputs.path }}
4383

44-
deploy:
45-
name: "Deploy"
46-
runs-on: ubuntu-latest
47-
timeout-minutes: 5
48-
needs: build
49-
50-
permissions:
51-
pages: write
52-
id-token: write
53-
54-
environment:
55-
name: github-pages
56-
url: ${{ steps.deployment.outputs.page_url }}
57-
58-
steps:
59-
- name: "Configure Pages"
60-
uses: actions/configure-pages@v3
84+
- name: "Upload Artifact"
85+
if: ${{ inputs.name != 'github-pages' }}
86+
uses: actions/upload-artifact@v5
87+
with:
88+
name: ${{ inputs.name }}
89+
path: ${{ inputs.path }}
90+
if-no-files-found: "error"
91+
include-hidden-files: true
6192

62-
- name: "Deploy Pages"
63-
id: deployment
64-
uses: actions/deploy-pages@v2
93+
- name: "Send Failure Notification"
94+
if: ${{ failure() }}
95+
uses: sarisia/actions-status-discord@v1
6596
with:
66-
artifact_name: github-pages
97+
webhook: ${{ secrets.DISCORD_WEBHOOK }}
98+
description: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}

0 commit comments

Comments
 (0)