Skip to content

Commit 9a62941

Browse files
Merge pull request #87 from Maciek-roboblog/v3.0.2
V3.0.2
2 parents 39a3b2f + 1c8b2ab commit 9a62941

File tree

93 files changed

+18723
-3871
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+18723
-3871
lines changed

.coderabbit.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 63 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,63 @@
1-
# name: Lint
2-
3-
# on:
4-
# push:
5-
# branches: [main]
6-
# pull_request:
7-
# branches: [main]
8-
9-
# jobs:
10-
# ruff:
11-
# runs-on: ubuntu-latest
12-
# name: Lint with Ruff
13-
# strategy:
14-
# matrix:
15-
# python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
16-
# steps:
17-
# - uses: actions/checkout@v4
18-
19-
# - name: Install uv
20-
# uses: astral-sh/setup-uv@v4
21-
# with:
22-
# version: "latest"
23-
24-
# - name: Set up Python ${{ matrix.python-version }}
25-
# run: uv python install ${{ matrix.python-version }}
26-
27-
# - name: Install dependencies
28-
# run: uv sync --extra dev
29-
30-
# - name: Run Ruff linter
31-
# run: uv run ruff check --output-format=github .
32-
33-
# - name: Run Ruff formatter
34-
# run: uv run ruff format --check .
35-
36-
# pre-commit:
37-
# runs-on: ubuntu-latest
38-
# name: Pre-commit hooks
39-
# strategy:
40-
# matrix:
41-
# python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
42-
# steps:
43-
# - uses: actions/checkout@v4
44-
45-
# - name: Install uv
46-
# uses: astral-sh/setup-uv@v4
47-
# with:
48-
# version: "latest"
49-
50-
# - name: Set up Python ${{ matrix.python-version }}
51-
# run: uv python install ${{ matrix.python-version }}
52-
53-
# - name: Install pre-commit
54-
# run: uv tool install pre-commit --with pre-commit-uv
55-
56-
# - name: Run pre-commit
57-
# run: |
58-
# # Run pre-commit and check if any files would be modified
59-
# uv tool run pre-commit run --all-files --show-diff-on-failure || (
60-
# echo "Pre-commit hooks would modify files. Please run 'pre-commit run --all-files' locally and commit the changes."
61-
# exit 1
62-
# )
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
ruff:
11+
runs-on: ubuntu-latest
12+
name: Lint with Ruff
13+
strategy:
14+
matrix:
15+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v4
21+
with:
22+
version: "latest"
23+
24+
- name: Set up Python ${{ matrix.python-version }}
25+
run: uv python install ${{ matrix.python-version }}
26+
27+
- name: Install dependencies
28+
run: uv sync --extra dev
29+
30+
- name: Run Ruff linter
31+
run: uv run ruff check --output-format=github .
32+
33+
- name: Run Ruff formatter
34+
run: uv run ruff format --check .
35+
36+
37+
pre-commit:
38+
runs-on: ubuntu-latest
39+
name: Pre-commit hooks
40+
strategy:
41+
matrix:
42+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- name: Install uv
47+
uses: astral-sh/setup-uv@v4
48+
with:
49+
version: "latest"
50+
51+
- name: Set up Python ${{ matrix.python-version }}
52+
run: uv python install ${{ matrix.python-version }}
53+
54+
- name: Install pre-commit
55+
run: uv tool install pre-commit --with pre-commit-uv
56+
57+
- name: Run pre-commit
58+
run: |
59+
# Run pre-commit and check if any files would be modified
60+
uv tool run pre-commit run --all-files --show-diff-on-failure || (
61+
echo "Pre-commit hooks would modify files. Please run 'pre-commit run --all-files' locally and commit the changes."
62+
exit 1
63+
)

.github/workflows/release.yml

Lines changed: 111 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,111 @@
1-
# name: Release
2-
3-
# on:
4-
# push:
5-
# branches: [main]
6-
# workflow_dispatch:
7-
8-
# jobs:
9-
# check-version:
10-
# runs-on: ubuntu-latest
11-
# outputs:
12-
# should_release: ${{ steps.check.outputs.should_release }}
13-
# version: ${{ steps.extract.outputs.version }}
14-
# steps:
15-
# - uses: actions/checkout@v4
16-
# with:
17-
# fetch-depth: 0
18-
19-
# - name: Extract version from pyproject.toml
20-
# id: extract
21-
# run: |
22-
# VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
23-
# echo "version=$VERSION" >> $GITHUB_OUTPUT
24-
# echo "Version: $VERSION"
25-
26-
# - name: Check if tag exists
27-
# id: check
28-
# run: |
29-
# VERSION="${{ steps.extract.outputs.version }}"
30-
# if git rev-parse "v$VERSION" >/dev/null 2>&1; then
31-
# echo "Tag v$VERSION already exists"
32-
# echo "should_release=false" >> $GITHUB_OUTPUT
33-
# else
34-
# echo "Tag v$VERSION does not exist"
35-
# echo "should_release=true" >> $GITHUB_OUTPUT
36-
# fi
37-
38-
# release:
39-
# needs: check-version
40-
# if: needs.check-version.outputs.should_release == 'true'
41-
# runs-on: ubuntu-latest
42-
# permissions:
43-
# contents: write
44-
# id-token: write # For trusted PyPI publishing
45-
# steps:
46-
# - uses: actions/checkout@v4
47-
# with:
48-
# fetch-depth: 0
49-
50-
# - name: Install uv
51-
# uses: astral-sh/setup-uv@v4
52-
# with:
53-
# version: "latest"
54-
55-
# - name: Set up Python
56-
# run: uv python install
57-
58-
# - name: Extract changelog for version
59-
# id: changelog
60-
# run: |
61-
# VERSION="${{ needs.check-version.outputs.version }}"
62-
# echo "Extracting changelog for version $VERSION"
63-
64-
# # Extract the changelog section for this version using sed
65-
# sed -n "/^## \\[$VERSION\\]/,/^## \\[/{/^## \\[$VERSION\\]/d; /^## \\[/q; /^$/d; p}" CHANGELOG.md > release_notes.md
66-
67-
# # If no changelog found, create a simple message
68-
# if [ ! -s release_notes.md ]; then
69-
# echo "No specific changelog found for version $VERSION" > release_notes.md
70-
# fi
71-
72-
# echo "Release notes:"
73-
# cat release_notes.md
74-
75-
# - name: Create git tag
76-
# run: |
77-
# VERSION="${{ needs.check-version.outputs.version }}"
78-
# git config user.name "GitHub Actions"
79-
# git config user.email "actions@github.com"
80-
# git tag -a "v$VERSION" -m "Release v$VERSION"
81-
# git push origin "v$VERSION"
82-
83-
# - name: Create GitHub Release
84-
# uses: softprops/action-gh-release@v2
85-
# with:
86-
# tag_name: v${{ needs.check-version.outputs.version }}
87-
# name: Release v${{ needs.check-version.outputs.version }}
88-
# body_path: release_notes.md
89-
# draft: false
90-
# prerelease: false
91-
92-
# - name: Build package
93-
# run: |
94-
# uv build
95-
# ls -la dist/
96-
97-
# - name: Publish to PyPI
98-
# uses: pypa/gh-action-pypi-publish@release/v1
99-
# with:
100-
# skip-existing: true
101-
102-
# notify-success:
103-
# needs: [check-version, release]
104-
# if: needs.check-version.outputs.should_release == 'true' && success()
105-
# runs-on: ubuntu-latest
106-
# steps:
107-
# - name: Success notification
108-
# run: |
109-
# echo "🎉 Successfully released v${{ needs.check-version.outputs.version }}!"
110-
# echo "- GitHub Release: https://github.com/${{ github.repository }}/releases/tag/v${{ needs.check-version.outputs.version }}"
111-
# echo "- PyPI: https://pypi.org/project/claude-monitor/${{ needs.check-version.outputs.version }}/"
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
jobs:
9+
check-version:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
should_release: ${{ steps.check.outputs.should_release }}
13+
version: ${{ steps.extract.outputs.version }}
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Extract version from pyproject.toml
20+
id: extract
21+
run: |
22+
VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
23+
echo "version=$VERSION" >> $GITHUB_OUTPUT
24+
echo "Version: $VERSION"
25+
26+
- name: Check if tag exists
27+
id: check
28+
run: |
29+
VERSION="${{ steps.extract.outputs.version }}"
30+
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
31+
echo "Tag v$VERSION already exists"
32+
echo "should_release=false" >> $GITHUB_OUTPUT
33+
else
34+
echo "Tag v$VERSION does not exist"
35+
echo "should_release=true" >> $GITHUB_OUTPUT
36+
fi
37+
38+
release:
39+
needs: check-version
40+
if: needs.check-version.outputs.should_release == 'true'
41+
runs-on: ubuntu-latest
42+
permissions:
43+
contents: write
44+
id-token: write # For trusted PyPI publishing
45+
steps:
46+
- uses: actions/checkout@v4
47+
with:
48+
fetch-depth: 0
49+
50+
- name: Install uv
51+
uses: astral-sh/setup-uv@v4
52+
with:
53+
version: "latest"
54+
55+
- name: Set up Python
56+
run: uv python install
57+
58+
- name: Extract changelog for version
59+
id: changelog
60+
run: |
61+
VERSION="${{ needs.check-version.outputs.version }}"
62+
echo "Extracting changelog for version $VERSION"
63+
64+
# Extract the changelog section for this version using sed
65+
sed -n "/^## \\[$VERSION\\]/,/^## \\[/{/^## \\[$VERSION\\]/d; /^## \\[/q; /^$/d; p}" CHANGELOG.md > release_notes.md
66+
67+
# If no changelog found, create a simple message
68+
if [ ! -s release_notes.md ]; then
69+
echo "No specific changelog found for version $VERSION" > release_notes.md
70+
fi
71+
72+
echo "Release notes:"
73+
cat release_notes.md
74+
75+
- name: Create git tag
76+
run: |
77+
VERSION="${{ needs.check-version.outputs.version }}"
78+
git config user.name "maciekdymarczyk"
79+
git config user.email "maciek@roboblog.eu"
80+
git tag -a "v$VERSION" -m "Release v$VERSION"
81+
git push origin "v$VERSION"
82+
83+
- name: Create GitHub Release
84+
uses: softprops/action-gh-release@v2
85+
with:
86+
tag_name: v${{ needs.check-version.outputs.version }}
87+
name: Release v${{ needs.check-version.outputs.version }}
88+
body_path: release_notes.md
89+
draft: false
90+
prerelease: false
91+
92+
- name: Build package
93+
run: |
94+
uv build
95+
ls -la dist/
96+
97+
- name: Publish to PyPI
98+
uses: pypa/gh-action-pypi-publish@release/v1
99+
with:
100+
skip-existing: true
101+
102+
notify-success:
103+
needs: [check-version, release]
104+
if: needs.check-version.outputs.should_release == 'true' && success()
105+
runs-on: ubuntu-latest
106+
steps:
107+
- name: Success notification
108+
run: |
109+
echo "🎉 Successfully released v${{ needs.check-version.outputs.version }}!"
110+
echo "- GitHub Release: https://github.com/${{ github.repository }}/releases/tag/v${{ needs.check-version.outputs.version }}"
111+
echo "- PyPI: https://pypi.org/project/claude-monitor/${{ needs.check-version.outputs.version }}/"

0 commit comments

Comments
 (0)