Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
896c4ab
infra: migrate to uv
JacobCoffee Oct 9, 2024
323cee3
infra: migrate to uv
JacobCoffee Oct 9, 2024
9b16ed9
ci: remove extra from template
JacobCoffee Oct 9, 2024
caf3e2e
ci: add changelog genny
JacobCoffee Oct 9, 2024
2e4f84a
Update README.md
JacobCoffee Oct 9, 2024
4d46fc6
chore: update startcmd
JacobCoffee Oct 9, 2024
5fbd4a8
fix: adjust targets
JacobCoffee Oct 9, 2024
49c40b6
fix: adjust for dep updates
JacobCoffee Oct 9, 2024
3a29068
fix: try to make railway happy
JacobCoffee Oct 9, 2024
b22d757
fix: try to make railway happy again
JacobCoffee Oct 9, 2024
91d4f7c
Revert "fix: try to make railway happy again"
JacobCoffee Oct 9, 2024
cec03f3
fix: try to make railway happy again 3
JacobCoffee Oct 9, 2024
0fa1ef0
fix: try to make railway happy again 4
JacobCoffee Oct 9, 2024
e5928c2
fix: try to make railway happy again 5
JacobCoffee Oct 9, 2024
707a53c
fix: try to make railway happy again 6
JacobCoffee Oct 9, 2024
8003b10
fix: try to make railway happy again 7
JacobCoffee Oct 9, 2024
fef0ad7
fix: try to make railway happy again 8
JacobCoffee Oct 10, 2024
8fa14fc
fix: try to make railway happy again 9
JacobCoffee Oct 10, 2024
5bf6d2e
fix: try to make railway happy again 10
JacobCoffee Oct 10, 2024
fc2c521
fix: try to make railway happy again 11
JacobCoffee Oct 10, 2024
7fa9f5d
fix: try to make railway happy again 12
JacobCoffee Oct 10, 2024
fa98e00
fix: try to make railway happy again 13
JacobCoffee Oct 10, 2024
c031637
python packaging is so fucking stupid
JacobCoffee Oct 10, 2024
3a96cf5
ci: apply lint
JacobCoffee Oct 11, 2024
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: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ DISCORD_DEV_USER_ID=IDOfYourDevUser

# --- Project Settings
# No Prefix for Project settings
LITESTAR_APP=src.app:create_app
LITESTAR_APP=byte_bot.app:create_app
WEB_URL=https://byte-bot.app
SECRET_KEY=ThisIsNotAProductionToken
ENVIRONMENT=dev
Expand Down
8 changes: 0 additions & 8 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
[//]: # "- follow [PSFs's Code of Conduct](https://www.python.org/psf/conduct/)"
[//]: # "- follow [Bytes's contribution guidelines](https://github.com/JacobCoffee/byte/blob/main/CONTRIBUTING.rst)"

### Pull Request Checklist

- [ ] New code has 100% test coverage
- [ ] (If applicable) The prose documentation has been updated to reflect the changes introduced by this PR
- [ ] (If applicable) The reference documentation has been updated to reflect the changes introduced by this PR
- [ ] Pre-Commit Checks were ran and passed
- [ ] Tests were ran and passed

### Description
[//]: # "Please describe your pull request for new release changelog purposes"

Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Continuous Deployment

on:
workflow_dispatch:


jobs:
generate-changelog:
name: Generate changelog
runs-on: ubuntu-22.04
outputs:
release_body: ${{ steps.git-cliff.outputs.content }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate a changelog
uses: orhun/git-cliff-action@main
id: git-cliff
with:
config: pyproject.toml
args: -vv --latest --strip header

- name: Commit changelog
run: |
git checkout main
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
set +e
git add docs/changelog.rst
git commit -m "docs: update changelog"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git main
64 changes: 30 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Set up Python
run: uv python install 3.11

- name: Install Pre-Commit
run: python -m pip install pre-commit && pre-commit install
- name: Create virtual environment
run: uv sync --all-extras --dev

- name: Install Pre-Commit hooks
run: uv run pre-commit install

- name: Load cached Pre-Commit Dependencies
id: cached-pre-commit-dependencies
Expand All @@ -27,14 +32,12 @@ jobs:
key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}

- name: Execute Pre-Commit
run: pre-commit run --show-diff-on-failure --color=always --all-files
run: uv run pre-commit run --show-diff-on-failure --color=always --all-files

test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.11"]
timeout-minutes: 15
defaults:
run:
Expand All @@ -43,18 +46,17 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- uses: pdm-project/setup-pdm@v3
name: Set up PDM
with:
python-version: ${{ matrix.python-version }}
allow-python-prereleases: true
cache: true
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install dependencies
run: pdm install
- name: Set up Python
run: uv python install 3.11

- name: Create virtual environment
run: uv sync --all-extras --dev

- name: Test
run: pdm run pytest
run: uv run pytest

build-docs:
env:
Expand All @@ -70,33 +72,27 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v3

- uses: pdm-project/setup-pdm@v3
name: Set up PDM
with:
python-version: "3.11"
allow-python-prereleases: true
cache: true
- name: Set up Python
run: uv python install 3.11

- name: Install dependencies
run: pdm install -G:docs
- name: Create virtual environment
run: uv sync --all-extras --dev

- name: Build docs
run: pdm run make docs
run: uv run make docs

- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
run: echo $PR_NUMBER > .pr_number
run: |
echo "${{ github.event.number }}" > .pr_number

- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: docs-preview
path: |
docs/_build/html
.pr_number
include-hidden-files: true
16 changes: 11 additions & 5 deletions .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,33 @@ jobs:
uses: actions/checkout@v4

- name: Download artifact
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v6
with:
workflow_conclusion: success
run_id: ${{ github.event.workflow_run.id }}
path: docs-preview
name: docs-preview

- name: Set PR number
run: echo "PR_NUMBER=$(cat docs-preview/.pr_number)" >> $GITHUB_ENV
- name: Validate and set PR number
run: |
PR_NUMBER=$(cat docs-preview/.pr_number)
if ! [[ "$PR_NUMBER" =~ ^[0-9]+$ ]]; then
echo "Invalid PR number: $PR_NUMBER"
exit 1
fi
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV

- name: Deploy docs preview
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs-preview/docs/_build/html
token: ${{ secrets.DOCS_PREVIEW_DEPLOY_TOKEN }}
token: ${{ secrets.DOCS_PREVIEW_DEPLOY_KEY }}
repository-name: JacobCoffee/byte-docs-preview
clean: false
target-folder: ${{ env.PR_NUMBER }}
branch: gh-pages

- uses: actions/github-script@v6
- uses: actions/github-script@v7
env:
PR_NUMBER: ${{ env.PR_NUMBER }}
with:
Expand Down
19 changes: 7 additions & 12 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,24 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v3

- uses: pdm-project/setup-pdm@v3
name: Set up PDM
with:
python-version: "3.11"
allow-python-prereleases: true
cache: true
- name: Set up Python
run: uv python install 3.11

- name: Install dependencies
run: pdm install -G:docs
run: uv sync --all-extras --dev

- name: Fetch gh pages
run: git fetch origin gh-pages --depth=1

- name: Build release docs
run: pdm run python tools/build_docs.py docs-build
run: uv run python tools/build_docs.py docs-build
if: github.event_name == 'release'

- name: Build dev docs
run: pdm run python tools/build_docs.py docs-build
run: uv run python tools/build_docs.py docs-build
if: github.event_name == 'push'

- name: Deploy
Expand Down
Loading