diff --git a/.github/README.md b/.github/README.md index 592a997..dd1b175 100644 --- a/.github/README.md +++ b/.github/README.md @@ -58,10 +58,18 @@ pipx install "$(ls dist/*.whl | head -n 1)" Install a published release artifact with `pipx`: ```bash -pipx install https://github.com/Splinter3D/StyleCheck/releases/download/vX.Y.Z/splinter3d_style-X.Y.Z-py3-none-any.whl +pipx install git+https://github.com/Splinter3D/StyleCheck splinter3d_style ``` +## Update From A Release + +Update a the package with pipx + +```bash +pipx upgrade splinter3d_style +``` + ## Use With pre-commit Add this repository and a release tag to your `.pre-commit-config.yaml`: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f0dd196..0acd98d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -114,10 +114,26 @@ jobs: path: dist - name: Create GitHub release - uses: softprops/action-gh-release@v3 - with: - tag_name: ${{ needs.prepare.outputs.tag_name }} - name: "Release: ${{ needs.prepare.outputs.tag_name }}" - files: dist/* - generate_release_notes: true - prerelease: ${{ needs.prepare.outputs.prerelease == 'true' }} + run: | + tag="${{ needs.prepare.outputs.tag_name }}" + title="Release: ${tag}" + + if gh release view "$tag" >/dev/null 2>&1; then + echo "Release $tag already exists, skipping." + exit 0 + fi + + args=( + release create "$tag" + dist/* + --title "$title" + --generate-notes + ) + + if [[ "${{ needs.prepare.outputs.prerelease }}" == "true" ]]; then + args+=(--prerelease) + fi + + gh "${args[@]}" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1cc4a04..13f8894 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: hooks: - id: check_versions name: check_versions - entry: bash -c 'scripts/check_versions.sh' + entry: bash -c 'scripts/check-versions.sh' language: system pass_filenames: false always_run: true @@ -33,3 +33,9 @@ repos: language: system pass_filenames: false always_run: true + - id: splinter3d-style + name: splinter3d-style + entry: bash -c 'poetry run splinter3d_style' + language: system + pass_filenames: false + always_run: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 2534a27..8f2728c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## v0.2.0-rc.2 (2026-07-08) + +### Fix + +- pre-release flow + +## v0.2.0-rc.1 (2026-07-08) + +### Feat + +- add style check to pre-commit + ## v0.1.5 (2026-07-08) ### Fix diff --git a/pyproject.toml b/pyproject.toml index 95a4cca..2d4705f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "splinter3d_style" -version = "0.1.5" +version = "0.2.0rc2" description = "A style checker for Splinter3D projects." readme = ".github/README.md" requires-python = ">=3.10,<4.0" diff --git a/scripts/bootstrap-pre-commit.sh b/scripts/bootstrap-pre-commit.sh index 4c45f84..13a589f 100755 --- a/scripts/bootstrap-pre-commit.sh +++ b/scripts/bootstrap-pre-commit.sh @@ -4,6 +4,5 @@ if ! command -v pre-commit &> /dev/null; then python3 -m pip install --user pre-commit || echo "Could not install pre-commit. Please install it with your package manager." && exit 1 fi pre-commit install -pre-commit install --hook-type pre-push || true pre-commit run --all-files || true echo "pre-commit hooks installed."