Skip to content

Commit 7f75be2

Browse files
committed
automate releases and fix linux workflow
Signed-off-by: Rahul Krishna <[email protected]>
1 parent afb3a8d commit 7f75be2

File tree

3 files changed

+145
-1
lines changed

3 files changed

+145
-1
lines changed

.github/workflows/release.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Python uv Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
permissions:
9+
contents: write # required for GitHub Release
10+
id-token: write # required for PyPI Trusted Publishing
11+
actions: write # required for tag deletion
12+
13+
jobs:
14+
release:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Check out code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python 3.12
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.12'
25+
26+
- name: Install uv
27+
run: |
28+
curl -LsSf https://astral.sh/uv/install.sh | sh
29+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
30+
31+
- name: Sync dependencies
32+
run: uv sync
33+
34+
- name: Run tests
35+
id: test
36+
continue-on-error: true
37+
run: uv run pytest
38+
39+
- name: Delete tag on failure
40+
if: steps.test.conclusion == 'failure'
41+
run: |
42+
echo "Tests failed. Deleting tag ${GITHUB_REF#refs/tags/}..."
43+
git config --global user.name "github-actions[bot]"
44+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
45+
git push --delete origin ${GITHUB_REF#refs/tags/}
46+
exit 1
47+
48+
- name: Build package
49+
run: uv build
50+
51+
- name: Build changelog
52+
id: gen_changelog
53+
uses: mikepenz/release-changelog-builder-action@v5
54+
with:
55+
failOnError: "true"
56+
configuration: .github/workflows/release_config.json
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
60+
- name: Publish release on GitHub
61+
uses: softprops/action-gh-release@v1
62+
with:
63+
files: dist/*
64+
body: ${{ steps.gen_changelog.outputs.changelog }}
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
68+
- name: Publish to PyPI via Trusted Publishing
69+
run: uv publish

.github/workflows/release_config.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"categories": [
3+
{
4+
"title": "## ✨ Release",
5+
"labels": [
6+
"release"
7+
]
8+
},
9+
{
10+
"title": "## 🚀 Features",
11+
"labels": [
12+
"kind/feature",
13+
"enhancement"
14+
]
15+
},
16+
{
17+
"title": "## 🐛 Fixes",
18+
"labels": [
19+
"fix",
20+
"bug"
21+
]
22+
},
23+
{
24+
"title": "## ♻️ Refactoring",
25+
"labels": [
26+
"refactoring"
27+
]
28+
},
29+
{
30+
"title": "## ⚡️ Performance Improvements",
31+
"labels": [
32+
"performance"
33+
]
34+
},
35+
{
36+
"title": "## \uD83D\uDCDA Documentation",
37+
"labels": [
38+
"documentation",
39+
"doc"
40+
]
41+
},
42+
{
43+
"title": "## \uD83D\uDEA6 Tests",
44+
"labels": [
45+
"test"
46+
]
47+
},
48+
{
49+
"title": "## \uD83D\uDEE0 Other Updates",
50+
"labels": [
51+
"other",
52+
"kind/dependency-change"
53+
]
54+
},
55+
{
56+
"title": "## 🚨 Breaking Changes",
57+
"labels": [
58+
"breaking"
59+
]
60+
}
61+
],
62+
"ignore_labels": [
63+
"ignore"
64+
]
65+
}

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111
- Input path validation in CLI main function to check if the provided input path exists
1212
- Logger import for better error handling and logging capabilities
13+
- Comprehensive system package requirements documentation in README.md
14+
- Platform-specific installation instructions for Ubuntu/Debian, Fedora/RHEL/CentOS, and macOS
15+
- Enhanced error reporting in command execution helper with detailed error output logging
16+
- Support for multiple Python version managers (pyenv, conda, asdf) in base interpreter detection
1317

1418
### Changed
1519
- Improved CLI error handling with proper logging when input path does not exist
1620
- Test configuration updates:
1721
- Removed unused app import from conftest.py
1822
- Updated test_cli_call_symbol_table to use verbose flag (-v) instead of --quiet flag
23+
- Improved virtual environment creation error handling with informative error messages
24+
- Enhanced `_get_base_interpreter()` method with robust Python interpreter detection across different environments
25+
- Updated README.md with detailed prerequisite packages including development tools and Python headers
1926

2027
### Fixed
2128
- CLI now properly exits with error code 1 when input path doesn't exist instead of proceeding with invalid path
29+
- Virtual environment creation issues on systems missing python3-venv package
30+
- Type safety issues in subprocess command execution by ensuring all arguments are strings
31+
- Cross-platform compatibility for Python interpreter detection
2232

2333
## [0.1.0] - Initial Release
2434

@@ -32,4 +42,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3242
- Caching system with configurable cache directory
3343
- Output artifacts in JSON format
3444
- Verbosity controls for logging
35-
- Eager/lazy analysis modes
45+
- Eager/lazy analysis modes

0 commit comments

Comments
 (0)