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.
- {pytgcli-0.8.1 → pytgcli-0.8.3}/.github/workflows/ci.yml +0 -1
- pytgcli-0.8.3/.github/workflows/publish.yml +162 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/PKG-INFO +1 -1
- {pytgcli-0.8.1 → pytgcli-0.8.3}/pyproject.toml +1 -1
- {pytgcli-0.8.1 → pytgcli-0.8.3}/uv.lock +1 -1
- pytgcli-0.8.1/.github/workflows/publish.yml +0 -17
- {pytgcli-0.8.1 → pytgcli-0.8.3}/.github/dependabot.yml +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/.gitignore +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/.pre-commit-config.yaml +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/.python-version +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/AGENTS.md +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/CLAUDE.md +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/LICENSE +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/README.md +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/install.sh +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/src/tgcli/__init__.py +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/src/tgcli/auth.py +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/src/tgcli/cli.py +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/src/tgcli/client.py +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/src/tgcli/config.py +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/src/tgcli/formatting.py +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/src/tgcli/session.py +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/src/tgcli/update.py +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/tests/__init__.py +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/tests/conftest.py +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/tests/test_auth.py +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/tests/test_cli.py +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/tests/test_client.py +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/tests/test_config.py +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/tests/test_formatting.py +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/tests/test_session.py +0 -0
- {pytgcli-0.8.1 → pytgcli-0.8.3}/tests/test_update.py +0 -0
|
@@ -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,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
|
|
File without changes
|