Skip to content
Draft
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
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.{bat,cmd}]
end_of_line = crlf

[*.{yml,yaml,json,toml}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
18 changes: 18 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Store everything as LF in the repo, check out as LF everywhere
* text=auto eol=lf

# Windows batch files genuinely need CRLF — cmd.exe mis-parses LF-only labels/goto
*.bat text eol=crlf
*.cmd text eol=crlf

# Belt and braces for binaries (Git usually detects these, but be explicit)
*.png binary
*.jpg binary
*.gif binary
*.ico binary
*.pdf binary
*.zip binary
*.whl binary
*.pyd binary
*.so binary
*.dll binary
220 changes: 110 additions & 110 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -1,111 +1,111 @@
name: Build and Deploy
on:
push:
branches:
- "**" # Match all branches, excludes tag pushes
permissions:
contents: write
jobs:
# Step 1: Build and upload package, runs on any git push
build-package:
name: Build package and upload artifact
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for full Git history and tags
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: 'pip'
- name: Install build tools
run: |
python -m pip install --upgrade build setuptools-git-versioning
- name: Get version
id: get_version
run: |
# Assuming pyproject.toml is at the root of the repository.
VERSION=$(python -c "import setuptools_git_versioning; print(setuptools_git_versioning.get_version(root='.'))")
echo "Calculated Version: $VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build package
run: python -m build
- name: Upload distribution artifact
uses: actions/upload-artifact@v4
with:
name: nexus-console-dist
path: dist/
# Step 2: Tag and Publish to PyPI, only runs on main
publish:
name: Tag and publish package to PyPI
runs-on: ubuntu-latest
needs: build-package
# Only run if on main branch and a version was determined for building
if: github.ref == 'refs/heads/main' && startsWith(needs.build-package.outputs.version, 'v')
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download package artifact
uses: actions/download-artifact@v4
with:
name: nexus-console-dist
path: dist/
- name: Set Git user for tagging
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
- name: Extract base version for tagging
id: tag_version_prep
run: |
RAW_VERSION="${{ needs.build-package.outputs.version }}"
TAG_VERSION="v$RAW_VERSION"
echo "Attempting to create tag: $TAG_VERSION"
echo "tag_version=$TAG_VERSION" >> $GITHUB_OUTPUT
- name: Check if Git tag already exists
id: check_tag
run: |
TAG_VERSION="${{ steps.tag_version_prep.outputs.tag_version }}"
if git rev-parse "$TAG_VERSION" >/dev/null 2>&1; then
echo "Tag $TAG_VERSION already exists"
echo "tag_exists=true" >> $GITHUB_OUTPUT
else
echo "Tag $TAG_VERSION does not exist"
echo "tag_exists=false" >> $GITHUB_OUTPUT
fi
- name: Create and push Git tag
if: steps.check_tag.outputs.tag_exists == 'false'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG_VERSION="${{ steps.tag_version_prep.outputs.tag_version }}"
git tag $TAG_VERSION
git push origin $TAG_VERSION
- name: Publish to PyPI
if: steps.check_tag.outputs.tag_exists == 'false'
uses: pypa/gh-action-pypi-publish@release/v1
with:
name: Build and Deploy

on:
push:
branches:
- "**" # Match all branches, excludes tag pushes

permissions:
contents: write

jobs:
# Step 1: Build and upload package, runs on any git push
build-package:
name: Build package and upload artifact
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for full Git history and tags

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: 'pip'

- name: Install build tools
run: |
python -m pip install --upgrade build setuptools-git-versioning

- name: Get version
id: get_version
run: |
# Assuming pyproject.toml is at the root of the repository.
VERSION=$(python -c "import setuptools_git_versioning; print(setuptools_git_versioning.get_version(root='.'))")
echo "Calculated Version: $VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "VERSION=$VERSION" >> $GITHUB_ENV

- name: Build package
run: python -m build

- name: Upload distribution artifact
uses: actions/upload-artifact@v4
with:
name: nexus-console-dist
path: dist/

# Step 2: Tag and Publish to PyPI, only runs on main
publish:
name: Tag and publish package to PyPI
runs-on: ubuntu-latest
needs: build-package
# Only run if on main branch and a version was determined for building
if: github.ref == 'refs/heads/main' && startsWith(needs.build-package.outputs.version, 'v')

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download package artifact
uses: actions/download-artifact@v4
with:
name: nexus-console-dist
path: dist/

- name: Set Git user for tagging
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"

- name: Extract base version for tagging
id: tag_version_prep
run: |
RAW_VERSION="${{ needs.build-package.outputs.version }}"
TAG_VERSION="v$RAW_VERSION"
echo "Attempting to create tag: $TAG_VERSION"
echo "tag_version=$TAG_VERSION" >> $GITHUB_OUTPUT

- name: Check if Git tag already exists
id: check_tag
run: |
TAG_VERSION="${{ steps.tag_version_prep.outputs.tag_version }}"
if git rev-parse "$TAG_VERSION" >/dev/null 2>&1; then
echo "Tag $TAG_VERSION already exists"
echo "tag_exists=true" >> $GITHUB_OUTPUT
else
echo "Tag $TAG_VERSION does not exist"
echo "tag_exists=false" >> $GITHUB_OUTPUT
fi

- name: Create and push Git tag
if: steps.check_tag.outputs.tag_exists == 'false'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG_VERSION="${{ steps.tag_version_prep.outputs.tag_version }}"
git tag $TAG_VERSION
git push origin $TAG_VERSION

- name: Publish to PyPI
if: steps.check_tag.outputs.tag_exists == 'false'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
98 changes: 49 additions & 49 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
name: Sphinx Docs
on:
push:
branches:
- main
- docu
pull_request:
permissions:
contents: write
jobs:
Documentation:
name: 'Build and deploy Documentation'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: 'pip'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install ".[docs]"
- name: Build docs
run: sphinx-build -b html ./docs/source ./docs/build/html
- name: Deploy to github pages
uses: peaceiris/actions-gh-pages@v3
if: github.event_name != 'pull_request'
with:
publish_branch: github-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build/html
- name: Save documentation
uses: actions/upload-artifact@v4
with:
name: Documentation
path: docs/build/html/
name: Sphinx Docs

on:
push:
branches:
- main
- docu
pull_request:

permissions:
contents: write

jobs:
Documentation:
name: 'Build and deploy Documentation'

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: 'pip'

- name: Install dependencies
run: |
pip install --upgrade pip
pip install ".[docs]"

- name: Build docs
run: sphinx-build -b html ./docs/source ./docs/build/html

- name: Deploy to github pages
uses: peaceiris/actions-gh-pages@v3
if: github.event_name != 'pull_request'
with:
publish_branch: github-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build/html

- name: Save documentation
uses: actions/upload-artifact@v4
with:
name: Documentation
path: docs/build/html/
Loading
Loading