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
87 changes: 87 additions & 0 deletions actions/build-dist/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: "Build Distribution"
description: "Build Python distribution packages using modern PEP 517 build tools"

inputs:
build-backend:
description: "Build backend to use (defaults to auto-detect from pyproject.toml)"
required: false
output-dir:
description: "Output directory for built distributions"
required: false
default: "dist"
sdist:
description: "Build source distribution"
required: false
default: "true"
wheel:
description: "Build wheel distribution"
required: false
default: "true"
ssh-private-key:
description: "SSH private key for installing private dependencies"
required: false

runs:
using: 'composite'
steps:
- name: Configure SSH
if: ${{ inputs.ssh-private-key }}
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ inputs.ssh-private-key }}

- name: Install Build Tools
shell: bash
run: |
set -e
echo "Installing modern build tools"
python -m pip install --upgrade pip build

- name: Install Dependencies
shell: bash
run: |
set -e
echo "::group::Installing project dependencies"

# Try different dependency files
if [ -f "pyproject.toml" ]; then
echo "Installing from pyproject.toml"
python -m pip install -e . || echo "Could not install in editable mode, continuing..."
elif [ -f "setup.cfg" ]; then
echo "Installing from setup.cfg"
python -m pip install -e . || echo "Could not install in editable mode, continuing..."
elif [ -f "requirements.txt" ]; then
echo "Installing from requirements.txt"
python -m pip install -r requirements.txt
fi

echo "::endgroup::"

- name: Build Distributions
shell: bash
run: |
set -e
echo "::group::Building distributions"

# Determine what to build
build_args=""

if [ "${{ inputs.sdist }}" = "true" ] && [ "${{ inputs.wheel }}" = "false" ]; then
build_args="--sdist"
elif [ "${{ inputs.wheel }}" = "true" ] && [ "${{ inputs.sdist }}" = "false" ]; then
build_args="--wheel"
fi
# If both true or both not specified, build will create both by default

# Set output directory
if [ -n "${{ inputs.output-dir }}" ]; then
build_args="$build_args --outdir ${{ inputs.output-dir }}"
fi

echo "Running: python -m build $build_args"
python -m build $build_args

echo "Built distributions:"
ls -lh ${{ inputs.output-dir }}/

echo "::endgroup::"
89 changes: 89 additions & 0 deletions actions/git-commit/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: "Git Commit"
description: "Commit and push changes to repository - modern, dependency-free"

inputs:
commit-message:
description: "Commit message"
required: true
add-pattern:
description: "Pattern for files to add (defaults to all changes)"
required: false
default: "."
push:
description: "Push changes to remote after committing"
required: false
default: "true"
branch:
description: "Branch to push to (defaults to current branch)"
required: false
ssh-private-key:
description: "SSH private key for pushing to remote"
required: false
git-email:
description: "Git user email"
required: false
default: "github-actions[bot]@users.noreply.github.com"
git-username:
description: "Git user name"
required: false
default: "github-actions[bot]"
allow-empty:
description: "Allow empty commits"
required: false
default: "false"

runs:
using: 'composite'
steps:
- name: Configure SSH
if: ${{ inputs.ssh-private-key }}
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ inputs.ssh-private-key }}

- name: Configure Git
shell: bash
run: |
set -e
git config --global user.email "${{ inputs.git-email }}"
git config --global user.name "${{ inputs.git-username }}"
echo "Configured git as: ${{ inputs.git-username }} <${{ inputs.git-email }}>"

- name: Commit Changes
shell: bash
run: |
set -e

# Add files
echo "Adding files matching pattern: ${{ inputs.add-pattern }}"
git add ${{ inputs.add-pattern }}

# Check if there are changes to commit
if git diff --staged --quiet; then
echo "No changes to commit"
if [ "${{ inputs.allow-empty }}" = "true" ]; then
echo "Creating empty commit (allow-empty=true)"
git commit --allow-empty -m "${{ inputs.commit-message }}"
else
echo "Skipping commit (no changes and allow-empty=false)"
exit 0
fi
else
echo "Committing changes"
git commit -m "${{ inputs.commit-message }}"
fi

- name: Push Changes
if: ${{ inputs.push == 'true' }}
shell: bash
run: |
set -e

if [ -n "${{ inputs.branch }}" ]; then
branch="${{ inputs.branch }}"
else
branch=$(git rev-parse --abbrev-ref HEAD)
fi

echo "Pushing to branch: $branch"
git push origin "$branch"
57 changes: 57 additions & 0 deletions actions/git-tag/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: "Git Tag"
description: "Tag repository and push tag to remote - modern, dependency-free"

inputs:
tag:
description: "Tag name (e.g., version number)"
required: true
message:
description: "Tag message (creates annotated tag if provided)"
required: false
push:
description: "Push tag to remote after creating"
required: false
default: "true"
force:
description: "Force create tag (overwrites existing tag)"
required: false
default: "false"

runs:
using: 'composite'
steps:
- name: Create Tag
shell: bash
run: |
set -e

tag_args=""

if [ "${{ inputs.force }}" = "true" ]; then
tag_args="$tag_args -f"
fi

if [ -n "${{ inputs.message }}" ]; then
echo "Creating annotated tag: ${{ inputs.tag }}"
git tag $tag_args -a "${{ inputs.tag }}" -m "${{ inputs.message }}"
else
echo "Creating lightweight tag: ${{ inputs.tag }}"
git tag $tag_args "${{ inputs.tag }}"
fi

echo "Tag created: ${{ inputs.tag }}"

- name: Push Tag
if: ${{ inputs.push == 'true' }}
shell: bash
run: |
set -e

push_args=""

if [ "${{ inputs.force }}" = "true" ]; then
push_args="$push_args --force"
fi

echo "Pushing tag to remote: ${{ inputs.tag }}"
git push $push_args origin "${{ inputs.tag }}"
109 changes: 109 additions & 0 deletions actions/install-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Install Dependencies
description: 'Modern dependency installation supporting pyproject.toml and requirements.txt'

inputs:
pypi-packages:
description: 'Python packages to install (space-separated)'
required: false
apt-packages:
description: 'APT packages to install (space-separated)'
required: false
npm-packages:
description: 'NPM packages to install (space-separated)'
required: false
dependency-files:
description: 'Comma-separated paths to dependency files (requirements.txt, setup.cfg, pyproject.toml)'
required: false
extras:
description: 'Install extras from pyproject.toml (e.g., "dev,test")'
required: false
ssh-private-key:
description: 'SSH private key for installing private packages from source'
required: false

runs:
using: 'composite'
steps:
- name: Configure SSH
if: ${{ inputs.ssh-private-key }}
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ inputs.ssh-private-key }}

- name: Install PyPI Packages
if: ${{ inputs.pypi-packages }}
shell: bash
run: |
set -e
echo "::group::Pip Installation Log"
echo "Upgrading pip"
python -m pip install --upgrade pip

echo "Installing packages: ${{ inputs.pypi-packages }}"
python -m pip install ${{ inputs.pypi-packages }}

echo "Installed package versions:"
python -m pip list | grep -E "$(echo ${{ inputs.pypi-packages }} | tr ' ' '|')" || true
echo "::endgroup::"

- name: Install APT Packages
if: ${{ inputs.apt-packages }}
shell: bash
run: |
set -e
echo "::group::APT Installation Log"
echo "Updating APT repositories"
sudo apt-get update
echo "Installing packages: ${{ inputs.apt-packages }}"
sudo apt-get install -y ${{ inputs.apt-packages }}
echo "::endgroup::"

- name: Install NPM Packages
if: ${{ inputs.npm-packages }}
shell: bash
run: |
set -e
echo "::group::NPM Installation Log"
echo "Installing packages: ${{ inputs.npm-packages }}"
npm install -g ${{ inputs.npm-packages }}
echo "::endgroup::"

- name: Install from Dependency Files
if: ${{ inputs.dependency-files }}
shell: bash
run: |
set -e
echo "::group::Dependencies Installation Log"
python -m pip install --upgrade pip

IFS=',' read -ra paths <<< "${{ inputs.dependency-files }}"
for path in "${paths[@]}"; do
path=$(echo "$path" | xargs) # Trim whitespace

if [[ $path == *.txt ]]; then
echo "Installing from requirements file: $path"
python -m pip install -r "$path"

elif [[ $path == *.toml ]]; then
echo "Installing from pyproject.toml: $path"
if [ -n "${{ inputs.extras }}" ]; then
python -m pip install -e ".[${{ inputs.extras }}]"
else
python -m pip install -e .
fi

elif [[ $path == *.cfg ]]; then
echo "Installing from setup.cfg: $path"
# For backward compatibility, use isee if available
if python -c "import isee" 2>/dev/null; then
isee install-requires
isee tests-require || true
else
python -m pip install -e .
fi
fi
done

echo "Installed Python packages:"
python -m pip list
echo "::endgroup::"
Loading