gitinsight-cli 0.1.0__tar.gz → 0.1.1__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.
@@ -0,0 +1,94 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build:
13
+ name: Build distributions
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - name: Checkout
18
+ uses: actions/checkout@v6
19
+
20
+ - name: Install uv
21
+ uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
22
+ with:
23
+ version: "0.11.21"
24
+
25
+ - name: Verify tag matches package version
26
+ shell: bash
27
+ run: |
28
+ package_version="$(uv version --short)"
29
+ tag_version="${GITHUB_REF_NAME#v}"
30
+
31
+ if [[ "$tag_version" != "$package_version" ]]; then
32
+ echo "::error::Tag version $tag_version does not match package version $package_version"
33
+ exit 1
34
+ fi
35
+
36
+ - name: Build wheel and source distribution
37
+ run: uv build
38
+
39
+ - name: Check distributions
40
+ run: uvx --no-config twine check dist/*
41
+
42
+ - name: Upload distributions
43
+ uses: actions/upload-artifact@v4
44
+ with:
45
+ name: python-package-distributions
46
+ path: dist/
47
+ if-no-files-found: error
48
+
49
+ release:
50
+ name: Create GitHub Release
51
+ needs: build
52
+ runs-on: ubuntu-latest
53
+ permissions:
54
+ contents: write
55
+
56
+ steps:
57
+ - name: Download distributions
58
+ uses: actions/download-artifact@v5
59
+ with:
60
+ name: python-package-distributions
61
+ path: dist/
62
+
63
+ - name: Create GitHub Release
64
+ uses: softprops/action-gh-release@v3
65
+ with:
66
+ files: dist/*
67
+ fail_on_unmatched_files: true
68
+ generate_release_notes: true
69
+ make_latest: true
70
+
71
+ publish:
72
+ name: Publish to PyPI
73
+ needs: release
74
+ runs-on: ubuntu-latest
75
+ environment:
76
+ name: pypi
77
+ url: https://pypi.org/project/gitinsight-cli/
78
+ permissions:
79
+ id-token: write
80
+
81
+ steps:
82
+ - name: Download distributions
83
+ uses: actions/download-artifact@v5
84
+ with:
85
+ name: python-package-distributions
86
+ path: dist/
87
+
88
+ - name: Install uv
89
+ uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
90
+ with:
91
+ version: "0.11.21"
92
+
93
+ - name: Publish distributions
94
+ run: uv publish --trusted-publishing always --check-url https://pypi.org/simple
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitinsight-cli
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: A powerful collection of Git repository analysis tools and visualizations.
5
5
  Project-URL: Homepage, https://github.com/Rain-kl/GitInsight
6
6
  Project-URL: Bug Tracker, https://github.com/Rain-kl/GitInsight/issues
@@ -23,8 +23,9 @@ GitRepository Analysis and Visualization Tool / Git 仓库分析与可视化工
23
23
  <!-- PROJECT SHIELDS -->
24
24
 
25
25
  [![MIT License][license-shield]][license-url]
26
-
27
- [![Python Version][python-version]][python-version]
26
+ [![PyPI Version][pypi-version]][pypi-url]
27
+ [![Python Versions][python-version]][pypi-url]
28
+ [![Release][release-shield]][release-url]
28
29
 
29
30
  ---
30
31
 
@@ -38,6 +39,7 @@ GitRepository Analysis and Visualization Tool / Git 仓库分析与可视化工
38
39
  - [文件目录说明](#文件目录说明)
39
40
  - [开发的架构](#开发的架构)
40
41
  - [部署](#部署)
42
+ - [发布新版本](#发布新版本)
41
43
  - [使用到的框架](#使用到的框架)
42
44
  - [贡献者](#贡献者)
43
45
  - [如何参与开源项目](#如何参与开源项目)
@@ -122,8 +124,30 @@ GitInsight
122
124
 
123
125
  ### 部署
124
126
 
125
- 本项目为 Python 命令行工具,可直接本地运行或打包发布到 PyPI。
126
- 暂无特殊部署部署。
127
+ 本项目作为 Python 命令行工具发布到
128
+ [PyPI](https://pypi.org/project/gitinsight-cli/),安装后的命令名为
129
+ `gitinsight`。
130
+
131
+ ### 发布新版本
132
+
133
+ 1. 更新 `pyproject.toml` 中的版本并刷新锁文件:
134
+
135
+ ```sh
136
+ uv version 0.2.0
137
+ uv lock
138
+ ```
139
+
140
+ 2. 提交版本变更,然后创建并推送同版本标签:
141
+
142
+ ```sh
143
+ git tag -a v0.2.0 -m "v0.2.0"
144
+ git push GitInsight main
145
+ git push GitInsight v0.2.0
146
+ ```
147
+
148
+ `v*` 标签会触发 GitHub Actions。工作流会校验标签与项目版本一致,
149
+ 构建 wheel 和源码包、创建 GitHub Release,并通过 PyPI Trusted
150
+ Publishing 发布,无需配置长期 PyPI Token。
127
151
 
128
152
  ### 使用到的框架
129
153
 
@@ -149,4 +173,8 @@ GitInsight
149
173
  <!-- links -->
150
174
  [license-shield]: https://img.shields.io/github/license/shaojintian/Best_README_template.svg?style=flat-square
151
175
  [license-url]: https://github.com/Rain-kl/GitInsight/blob/main/LICENSE
152
- [python-version]:https://img.shields.io/pypi/pyversions/pandas
176
+ [pypi-version]: https://img.shields.io/pypi/v/gitinsight-cli
177
+ [pypi-url]: https://pypi.org/project/gitinsight-cli/
178
+ [python-version]: https://img.shields.io/pypi/pyversions/gitinsight-cli
179
+ [release-shield]: https://github.com/Rain-kl/GitInsight/actions/workflows/release.yml/badge.svg
180
+ [release-url]: https://github.com/Rain-kl/GitInsight/actions/workflows/release.yml
@@ -5,8 +5,9 @@ GitRepository Analysis and Visualization Tool / Git 仓库分析与可视化工
5
5
  <!-- PROJECT SHIELDS -->
6
6
 
7
7
  [![MIT License][license-shield]][license-url]
8
-
9
- [![Python Version][python-version]][python-version]
8
+ [![PyPI Version][pypi-version]][pypi-url]
9
+ [![Python Versions][python-version]][pypi-url]
10
+ [![Release][release-shield]][release-url]
10
11
 
11
12
  ---
12
13
 
@@ -20,6 +21,7 @@ GitRepository Analysis and Visualization Tool / Git 仓库分析与可视化工
20
21
  - [文件目录说明](#文件目录说明)
21
22
  - [开发的架构](#开发的架构)
22
23
  - [部署](#部署)
24
+ - [发布新版本](#发布新版本)
23
25
  - [使用到的框架](#使用到的框架)
24
26
  - [贡献者](#贡献者)
25
27
  - [如何参与开源项目](#如何参与开源项目)
@@ -104,8 +106,30 @@ GitInsight
104
106
 
105
107
  ### 部署
106
108
 
107
- 本项目为 Python 命令行工具,可直接本地运行或打包发布到 PyPI。
108
- 暂无特殊部署部署。
109
+ 本项目作为 Python 命令行工具发布到
110
+ [PyPI](https://pypi.org/project/gitinsight-cli/),安装后的命令名为
111
+ `gitinsight`。
112
+
113
+ ### 发布新版本
114
+
115
+ 1. 更新 `pyproject.toml` 中的版本并刷新锁文件:
116
+
117
+ ```sh
118
+ uv version 0.2.0
119
+ uv lock
120
+ ```
121
+
122
+ 2. 提交版本变更,然后创建并推送同版本标签:
123
+
124
+ ```sh
125
+ git tag -a v0.2.0 -m "v0.2.0"
126
+ git push GitInsight main
127
+ git push GitInsight v0.2.0
128
+ ```
129
+
130
+ `v*` 标签会触发 GitHub Actions。工作流会校验标签与项目版本一致,
131
+ 构建 wheel 和源码包、创建 GitHub Release,并通过 PyPI Trusted
132
+ Publishing 发布,无需配置长期 PyPI Token。
109
133
 
110
134
  ### 使用到的框架
111
135
 
@@ -131,4 +155,8 @@ GitInsight
131
155
  <!-- links -->
132
156
  [license-shield]: https://img.shields.io/github/license/shaojintian/Best_README_template.svg?style=flat-square
133
157
  [license-url]: https://github.com/Rain-kl/GitInsight/blob/main/LICENSE
134
- [python-version]:https://img.shields.io/pypi/pyversions/pandas
158
+ [pypi-version]: https://img.shields.io/pypi/v/gitinsight-cli
159
+ [pypi-url]: https://pypi.org/project/gitinsight-cli/
160
+ [python-version]: https://img.shields.io/pypi/pyversions/gitinsight-cli
161
+ [release-shield]: https://github.com/Rain-kl/GitInsight/actions/workflows/release.yml/badge.svg
162
+ [release-url]: https://github.com/Rain-kl/GitInsight/actions/workflows/release.yml
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "gitinsight-cli"
3
- version = "0.1.0"
3
+ version = "0.1.1"
4
4
  description = "A powerful collection of Git repository analysis tools and visualizations."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -21,7 +21,7 @@ wheels = [
21
21
 
22
22
  [[package]]
23
23
  name = "gitinsight-cli"
24
- version = "0.1.0"
24
+ version = "0.1.1"
25
25
  source = { editable = "." }
26
26
  dependencies = [
27
27
  { name = "loguru" },
@@ -1,70 +0,0 @@
1
- name: Auto Release Wheel
2
-
3
- on:
4
- push:
5
- branches: [ "main" ]
6
- workflow_dispatch:
7
-
8
- permissions:
9
- contents: write
10
-
11
- jobs:
12
- build-and-release:
13
- name: Build and Release Wheel
14
- runs-on: ubuntu-latest
15
-
16
- steps:
17
- - name: Checkout code
18
- uses: actions/checkout@v4
19
-
20
- - name: Install uv
21
- uses: astral-sh/setup-uv@v5
22
-
23
- - name: Set up Python
24
- run: uv python install
25
-
26
- - name: Generate Version Number
27
- id: version
28
- run: |
29
- # Use current timestamp as version: YYYY.MM.DD.HHMMSS
30
- # Using UTC time to avoid timezone confusion and ensure monotonicity
31
- VERSION_NUM=$(date -u +'%Y.%m.%d.%H%M%S')
32
- echo "VERSION_NUM=$VERSION_NUM" >> $GITHUB_ENV
33
- echo "Generated version: $VERSION_NUM"
34
-
35
- - name: Update pyproject.toml version
36
- run: |
37
- # Simple sed replacement for the version field
38
- # Matches 'version = "..."'
39
- sed -i "s/version = \".*\"/version = \"${{ env.VERSION_NUM }}\"/" pyproject.toml
40
- echo "Updated pyproject.toml version:"
41
- grep "version =" pyproject.toml
42
-
43
- - name: Build Wheel
44
- run: |
45
- uv build
46
-
47
- # Verify the output
48
- echo "Build artifacts:"
49
- ls -l dist/
50
-
51
- - name: Create Release
52
- uses: softprops/action-gh-release@v2
53
- with:
54
- tag_name: "v${{ env.VERSION_NUM }}"
55
- name: "Release v${{ env.VERSION_NUM }}"
56
- files: dist/*.whl
57
- make_latest: true
58
- body: |
59
- Auto-generated release from GitHub Actions.
60
- Version: ${{ env.VERSION_NUM }}
61
- Build Time: $(date)
62
-
63
- ## Platform Support
64
- This release contains a **Pure Python Wheel** (`*-py3-none-any.whl`).
65
- It is compatible with:
66
- - ✅ **Windows (x64/ARM64)**
67
- - ✅ **Linux (x64/ARM64)**
68
- - ✅ **macOS (x64/ARM64)**
69
-
70
- Requires Python 3.12+.