diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0cfc785..f6912e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: ["**"] + branches: ["main"] pull_request: - branches: ["**"] + branches: ["main"] jobs: test: diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/deploy-gh-pages.yml similarity index 88% rename from .github/workflows/jekyll-gh-pages.yml rename to .github/workflows/deploy-gh-pages.yml index abea45d..8ce1918 100644 --- a/.github/workflows/jekyll-gh-pages.yml +++ b/.github/workflows/deploy-gh-pages.yml @@ -1,9 +1,9 @@ # Sample workflow for building and deploying a Jekyll site to GitHub Pages -name: Deploy Jekyll with GitHub Pages dependencies preinstalled +name: Deploy GitHub Pages on: workflow_run: - workflows: ["publish"] + workflows: ["Publish to PyPI"] types: [completed] # Allows you to run this workflow manually from the Actions tab @@ -25,6 +25,7 @@ jobs: # Build job build: runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish-pypi.yml similarity index 95% rename from .github/workflows/publish.yml rename to .github/workflows/publish-pypi.yml index 2ad2f8b..236c04f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish-pypi.yml @@ -1,4 +1,4 @@ -name: Publish +name: Publish to PyPi on: push: diff --git a/.gitignore b/.gitignore index fe89a3a..298d749 100644 --- a/.gitignore +++ b/.gitignore @@ -175,3 +175,41 @@ pyrightconfig.json # End of https://www.toptal.com/developers/gitignore/api/python +# Created by https://www.toptal.com/developers/gitignore/api/macos +# Edit at https://www.toptal.com/developers/gitignore?templates=macos + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +# End of https://www.toptal.com/developers/gitignore/api/macos +uv.lock \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..853dd52 --- /dev/null +++ b/Makefile @@ -0,0 +1,42 @@ +.PHONY: lint typecheck test all \ + changelog changelog-preview changelog-bump release + +# ── CI / quality ──────────────────────────────────────────────────────────── + +lint: + ruff check . + +typecheck: + mypy src/ + +test: + pytest --cov=src --cov-report=term-missing + +all: lint typecheck test + +# ── Changelog / release ────────────────────────────────────────────────────── + +# Preview what the next changelog entry will look like (dry-run, no files changed) +changelog-preview: + git cliff --unreleased --bump + +# Show what the next version number will be +changelog-bump: + git cliff --bumped-version + +# Prepend new entries to CHANGELOG.md for the next release +changelog: + $(eval VERSION := $(shell git cliff --bumped-version 2>/dev/null)) + touch CHANGELOG.md + git cliff --unreleased --prepend CHANGELOG.md --bump + @echo "CHANGELOG.md updated to $(VERSION). Review, then run: make release" + +# Full release: update changelog, commit, tag, push +release: + $(eval VERSION := $(shell git cliff --bumped-version 2>/dev/null)) + git add CHANGELOG.md + @git commit -m "chore: release $(VERSION)" || { echo "Error: CHANGELOG.md unchanged. Run 'make changelog' first."; exit 1; } + git tag $(VERSION) + git push origin main + git push origin $(VERSION) + @echo "Released $(VERSION)" \ No newline at end of file diff --git a/README.md b/README.md index 549cb58..299ea19 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Reusable Dev Containers for any project — without modifying the repository. --- -![](https://github.com/dacrystal/dev-code/raw/main/demo/demo.gif "Demo gif") +![](assets/demo.gif "Demo gif") `devcode` is a CLI that opens any project in VS Code Dev Containers using reusable, local templates. @@ -50,11 +50,11 @@ Typical Dev Container workflows involve: # Install pip install dev-code -# Create default template -devcode init +# Open a project (auto-detects template from container history, or uses default) +devcode open ~/projects/my-app -# Open a project -devcode open dev-code ~/projects/my-app +# Open with an explicit template +devcode open ~/projects/my-app dev-code # Reopen projects later devcode ps -a -i @@ -81,14 +81,7 @@ Default location: ~/.local/share/dev-code/templates/ ``` -Override search paths: - -```bash -DEVCODE_TEMPLATE_PATH=/my/templates:/team/templates -``` - -* The first path is used for writes -* Additional paths are read-only +Override search paths via `settings.json` (see [Configuration](#configuration)). --- @@ -105,14 +98,16 @@ DEVCODE_TEMPLATE_PATH=/my/templates:/team/templates ### devcode open ```bash -devcode open