pytgcli 0.8.1__tar.gz → 0.8.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. {pytgcli-0.8.1 → pytgcli-0.8.3}/.github/workflows/ci.yml +0 -1
  2. pytgcli-0.8.3/.github/workflows/publish.yml +162 -0
  3. {pytgcli-0.8.1 → pytgcli-0.8.3}/PKG-INFO +1 -1
  4. {pytgcli-0.8.1 → pytgcli-0.8.3}/pyproject.toml +1 -1
  5. {pytgcli-0.8.1 → pytgcli-0.8.3}/uv.lock +1 -1
  6. pytgcli-0.8.1/.github/workflows/publish.yml +0 -17
  7. {pytgcli-0.8.1 → pytgcli-0.8.3}/.github/dependabot.yml +0 -0
  8. {pytgcli-0.8.1 → pytgcli-0.8.3}/.gitignore +0 -0
  9. {pytgcli-0.8.1 → pytgcli-0.8.3}/.pre-commit-config.yaml +0 -0
  10. {pytgcli-0.8.1 → pytgcli-0.8.3}/.python-version +0 -0
  11. {pytgcli-0.8.1 → pytgcli-0.8.3}/AGENTS.md +0 -0
  12. {pytgcli-0.8.1 → pytgcli-0.8.3}/CLAUDE.md +0 -0
  13. {pytgcli-0.8.1 → pytgcli-0.8.3}/LICENSE +0 -0
  14. {pytgcli-0.8.1 → pytgcli-0.8.3}/README.md +0 -0
  15. {pytgcli-0.8.1 → pytgcli-0.8.3}/install.sh +0 -0
  16. {pytgcli-0.8.1 → pytgcli-0.8.3}/src/tgcli/__init__.py +0 -0
  17. {pytgcli-0.8.1 → pytgcli-0.8.3}/src/tgcli/auth.py +0 -0
  18. {pytgcli-0.8.1 → pytgcli-0.8.3}/src/tgcli/cli.py +0 -0
  19. {pytgcli-0.8.1 → pytgcli-0.8.3}/src/tgcli/client.py +0 -0
  20. {pytgcli-0.8.1 → pytgcli-0.8.3}/src/tgcli/config.py +0 -0
  21. {pytgcli-0.8.1 → pytgcli-0.8.3}/src/tgcli/formatting.py +0 -0
  22. {pytgcli-0.8.1 → pytgcli-0.8.3}/src/tgcli/session.py +0 -0
  23. {pytgcli-0.8.1 → pytgcli-0.8.3}/src/tgcli/update.py +0 -0
  24. {pytgcli-0.8.1 → pytgcli-0.8.3}/tests/__init__.py +0 -0
  25. {pytgcli-0.8.1 → pytgcli-0.8.3}/tests/conftest.py +0 -0
  26. {pytgcli-0.8.1 → pytgcli-0.8.3}/tests/test_auth.py +0 -0
  27. {pytgcli-0.8.1 → pytgcli-0.8.3}/tests/test_cli.py +0 -0
  28. {pytgcli-0.8.1 → pytgcli-0.8.3}/tests/test_client.py +0 -0
  29. {pytgcli-0.8.1 → pytgcli-0.8.3}/tests/test_config.py +0 -0
  30. {pytgcli-0.8.1 → pytgcli-0.8.3}/tests/test_formatting.py +0 -0
  31. {pytgcli-0.8.1 → pytgcli-0.8.3}/tests/test_session.py +0 -0
  32. {pytgcli-0.8.1 → pytgcli-0.8.3}/tests/test_update.py +0 -0
@@ -4,7 +4,6 @@ on:
4
4
  push:
5
5
  branches: [main]
6
6
  pull_request:
7
- branches: [main]
8
7
 
9
8
  jobs:
10
9
  lint:
@@ -0,0 +1,162 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ jobs:
9
+ verify:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: read
13
+ steps:
14
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
15
+ with:
16
+ ref: ${{ github.ref_name }}
17
+ - name: Verify tag matches pyproject version
18
+ run: |
19
+ TAG_VERSION="${{ github.ref_name }}"
20
+ TAG_VERSION="${TAG_VERSION#v}"
21
+ PROJECT_VERSION="$(python3 -c "import tomllib;print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")"
22
+ if [ "$TAG_VERSION" != "$PROJECT_VERSION" ]; then
23
+ echo "Tag version ($TAG_VERSION) does not match pyproject version ($PROJECT_VERSION)."
24
+ exit 1
25
+ fi
26
+
27
+ build:
28
+ needs: verify
29
+ runs-on: ubuntu-latest
30
+ permissions:
31
+ contents: read
32
+ steps:
33
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
34
+ with:
35
+ ref: ${{ github.ref_name }}
36
+ - uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
37
+ - run: uv build
38
+ - uses: actions/upload-artifact@v4
39
+ with:
40
+ name: dist
41
+ path: dist/*
42
+
43
+ github-release:
44
+ needs: build
45
+ runs-on: ubuntu-latest
46
+ permissions:
47
+ contents: write
48
+ steps:
49
+ - uses: actions/download-artifact@v4
50
+ with:
51
+ name: dist
52
+ path: dist
53
+ - name: Create GitHub release and upload assets
54
+ env:
55
+ GH_TOKEN: ${{ github.token }}
56
+ run: |
57
+ if gh release view "${{ github.ref_name }}" --repo "${{ github.repository }}" > /dev/null 2>&1; then
58
+ echo "Release ${{ github.ref_name }} already exists."
59
+ else
60
+ gh release create "${{ github.ref_name }}" \
61
+ --repo "${{ github.repository }}" \
62
+ --title "${{ github.ref_name }}" \
63
+ --notes "Automated release for ${{ github.ref_name }}"
64
+ fi
65
+ gh release upload "${{ github.ref_name }}" dist/* --repo "${{ github.repository }}" --clobber
66
+
67
+ publish-pypi:
68
+ needs: build
69
+ runs-on: ubuntu-latest
70
+ environment: pypi
71
+ permissions:
72
+ id-token: write
73
+ contents: read
74
+ steps:
75
+ - uses: actions/download-artifact@v4
76
+ with:
77
+ name: dist
78
+ path: dist
79
+ - uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
80
+ - run: uv publish --trusted-publishing always dist/*
81
+
82
+ update-homebrew-tap:
83
+ needs:
84
+ - github-release
85
+ - publish-pypi
86
+ runs-on: ubuntu-latest
87
+ permissions:
88
+ contents: read
89
+ env:
90
+ TAP_REPO: tksohishi/homebrew-tap
91
+ TAP_TOKEN: ${{ secrets.TAP_GH_TOKEN }}
92
+ steps:
93
+ - name: Validate tap token
94
+ run: |
95
+ if [ -z "${TAP_TOKEN}" ]; then
96
+ echo "TAP_GH_TOKEN is required to update homebrew-tap."
97
+ exit 1
98
+ fi
99
+
100
+ - name: Resolve PyPI source artifact
101
+ env:
102
+ VERSION: ${{ github.ref_name }}
103
+ run: |
104
+ export TAG_VERSION="${VERSION#v}"
105
+ python3 <<'PY'
106
+ import json
107
+ import os
108
+ import urllib.request
109
+
110
+ version = os.environ["TAG_VERSION"]
111
+ url = f"https://pypi.org/pypi/pytgcli/{version}/json"
112
+ with urllib.request.urlopen(url) as response:
113
+ data = json.load(response)
114
+
115
+ sdist = next(item for item in data["urls"] if item["packagetype"] == "sdist")
116
+ with open(os.environ["GITHUB_ENV"], "a", encoding="utf-8") as env_file:
117
+ env_file.write(f"TGCLI_VERSION={version}\n")
118
+ env_file.write(f"TGCLI_SDIST_URL={sdist['url']}\n")
119
+ env_file.write(f"TGCLI_SDIST_SHA256={sdist['digests']['sha256']}\n")
120
+ PY
121
+
122
+ - name: Update formula in tap repo
123
+ run: |
124
+ git clone "https://x-access-token:${TAP_TOKEN}@github.com/${TAP_REPO}.git" tap-repo
125
+ python3 <<'PY'
126
+ import os
127
+ import re
128
+ from pathlib import Path
129
+
130
+ formula_path = Path("tap-repo/Formula/tgcli.rb")
131
+ content = formula_path.read_text(encoding="utf-8")
132
+ content, url_replacements = re.subn(
133
+ r'^ url ".*"$',
134
+ f' url "{os.environ["TGCLI_SDIST_URL"]}"',
135
+ content,
136
+ count=1,
137
+ flags=re.MULTILINE,
138
+ )
139
+ content, sha_replacements = re.subn(
140
+ r'^ sha256 ".*"$',
141
+ f' sha256 "{os.environ["TGCLI_SDIST_SHA256"]}"',
142
+ content,
143
+ count=1,
144
+ flags=re.MULTILINE,
145
+ )
146
+ if url_replacements != 1 or sha_replacements != 1:
147
+ raise RuntimeError("Failed to patch tgcli.rb top-level url/sha256")
148
+ formula_path.write_text(content, encoding="utf-8")
149
+ PY
150
+
151
+ - name: Commit and push formula update
152
+ run: |
153
+ cd tap-repo
154
+ git config user.name "github-actions[bot]"
155
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
156
+ git add Formula/tgcli.rb
157
+ if git diff --cached --quiet; then
158
+ echo "No formula changes to push."
159
+ exit 0
160
+ fi
161
+ git commit -m "chore: update tgcli formula to v${TGCLI_VERSION}"
162
+ git push origin main
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytgcli
3
- Version: 0.8.1
3
+ Version: 0.8.3
4
4
  Summary: CLI tool to read Telegram messages from the terminal
5
5
  Project-URL: Repository, https://github.com/tksohishi/tgcli
6
6
  Author: Takeshi
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "pytgcli"
7
- version = "0.8.1"
7
+ version = "0.8.3"
8
8
  description = "CLI tool to read Telegram messages from the terminal"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -579,7 +579,7 @@ wheels = [
579
579
 
580
580
  [[package]]
581
581
  name = "pytgcli"
582
- version = "0.8.1"
582
+ version = "0.8.3"
583
583
  source = { editable = "." }
584
584
  dependencies = [
585
585
  { name = "keyring" },
@@ -1,17 +0,0 @@
1
- name: Publish to PyPI
2
-
3
- on:
4
- release:
5
- types: [published]
6
-
7
- jobs:
8
- publish:
9
- runs-on: ubuntu-latest
10
- environment: pypi
11
- permissions:
12
- id-token: write
13
- steps:
14
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
15
- - uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
16
- - run: uv build
17
- - run: uv publish --trusted-publishing always
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes