Skip to content
This repository was archived by the owner on Nov 23, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
67b8104
Initial plan
Copilot Nov 20, 2025
61bc904
Changes before error encountered
Copilot Nov 20, 2025
d2c8b88
Complete Python port with Pythonic structure, argparse CLI, and CI/CD
Copilot Nov 20, 2025
fe97f0c
Add PyPI setup guide for reserving package name
Copilot Nov 20, 2025
607d3c9
Address code review feedback and add test dependency to build
Copilot Nov 20, 2025
a7762b3
Clarify PyPI upload process - upload built packages not repo
Copilot Nov 20, 2025
3a78f36
Add comprehensive GitHub environment configuration guide
Copilot Nov 20, 2025
ad6cea9
Rename to README.DEPLOYMENT.md and update references
Copilot Nov 20, 2025
81f8772
Add security scanning to CI/CD pipeline
Copilot Nov 20, 2025
d251022
Simplify documentation and add rungit module
Copilot Nov 20, 2025
6384eef
Fix CI: install package before running tests
Copilot Nov 20, 2025
cfd863c
Consolidate external calls into runshell module
Copilot Nov 21, 2025
d623554
Add Python 3.13 to test matrix
Copilot Nov 21, 2025
4e265a6
Add Windows shell testing for both PowerShell and cmd.exe
Copilot Nov 21, 2025
54ccd24
Update test matrix and remove legacy Go files
Copilot Nov 21, 2025
3d1e3ce
Add WSL bash testing for Windows
Copilot Nov 21, 2025
c906f7b
Fix WSL Python installation for newer versions
Copilot Nov 21, 2025
f5c2648
Ensure consistent dependency installation across environments
Copilot Nov 21, 2025
17c100a
Add fail-fast: false and improve test coverage to 29%
Copilot Nov 21, 2025
4c0041a
Fix black formatting for test_console.py
Copilot Nov 21, 2025
5e65633
Temporarily disable non-WSL tests to debug WSL issues
Copilot Nov 21, 2025
a87e140
Massively improve test coverage to 65%
Copilot Nov 21, 2025
4ae65dc
Re-enable all platform tests - WSL issues resolved
Copilot Nov 21, 2025
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
178 changes: 178 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
name: Publish Python Package

on:
push:
tags:
- 'v*.*.*'

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -r requirements-dev.txt

- name: Lint with flake8
run: |
flake8 src/gitspaces --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 src/gitspaces --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Check code formatting with black
run: |
black --check src/gitspaces tests

- name: Run tests with pytest
run: |
pytest tests/ -v --cov=src/gitspaces --cov-report=xml --cov-report=term

build:
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4

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

- name: Extract version from tag
id: get_version
run: |
# Remove 'v' prefix from tag
VERSION=${GITHUB_REF#refs/tags/v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Update version in pyproject.toml
run: |
sed -i 's/^version = ".*"/version = "${{ steps.get_version.outputs.version }}"/' pyproject.toml

- name: Update version in __init__.py
run: |
sed -i 's/__version__ = ".*"/__version__ = "${{ steps.get_version.outputs.version }}"/' src/gitspaces/__init__.py

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine

- name: Build package
run: python -m build

- name: Rename distribution files
run: |
cd dist
for file in *; do
# Add gitspaces- prefix if not already present
if [[ ! "$file" =~ ^gitspaces- ]]; then
mv "$file" "gitspaces-${{ steps.get_version.outputs.tag }}-${file}"
fi
done
ls -la

- name: Check package
run: twine check dist/*

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

test-pypi-publish:
name: Publish to TestPyPI
needs: build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/gitspaces
permissions:
id-token: write

steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

github-release:
name: Create GitHub Release
needs: test-pypi-publish
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4

- name: Extract version from tag
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
TAG=${GITHUB_REF#refs/tags/}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=$TAG" >> $GITHUB_OUTPUT

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: dist/*
tag_name: ${{ steps.get_version.outputs.tag }}
name: Release ${{ steps.get_version.outputs.tag }}
draft: false
prerelease: false
generate_release_notes: true

pypi-publish:
name: Publish to PyPI
needs: github-release
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/gitspaces
permissions:
id-token: write

steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Loading
Loading