Skip to content

Commit 6f4cd29

Browse files
committed
chore: improve GitHub issue templates and release workflow
Remove zip archive creation and enhance release notes with categorized commits and contributor attribution. Update project metadata with version 0.3.2-beta and add uv.lock file.
1 parent bdd9194 commit 6f4cd29

5 files changed

Lines changed: 125 additions & 34 deletions

File tree

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,41 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: "bug: "
4+
title: "🐞 bug: "
55
labels: bug
66
assignees: ""
77
---
88

9-
**please complete the following information:**
9+
**Versions**
1010

11-
- OS: [e.g. iOS]
12-
- Version [e.g. 0.2.3-beta]
13-
- Python version [e.g 3.11]
11+
- AutoTarCompress version: <!-- e.g: 0.10.10-alpha -->
12+
- Python version: <!-- [e.g 3.12] -->
1413

1514
**Describe the bug**
16-
A clear and concise description of what the bug is.
1715

18-
**To Reproduce**
19-
Steps to reproduce the behavior:
16+
<!-- A clear and concise description of what the bug is. -->
2017

21-
1. python3 main.py
22-
2. select choice 3
23-
3. See choice 1... 2..., select 2
24-
4. See this error:
18+
**Console Output**
2519

26-
```python
20+
<!-- Place to output in the below in the quotes -->
21+
22+
```
2723
2824
```
2925

3026
**Expected behavior**
31-
A clear and concise description of what you expected to happen.
3227

33-
**Additional context**
34-
Add any other context about the problem here.
28+
<!-- A clear and concise description of what you expected to happen. -->
29+
30+
**LOG**
31+
32+
> Paste the log(`/home/<your_username>/.local/state/my-unicorn/my-unicorn.log`) here:
3533
3634
```
3735
36+
3837
```
38+
39+
**Additional context**
40+
41+
<!-- Add any other context about the problem here. -->
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project
4-
title: "feat: "
4+
title: "🚀 feat: "
55
labels: enhancement
66
assignees: ""
77
---
88

99
**Is your feature request related to a problem? Please describe.**
10-
A clear and concise description of what the problem is.
11-
Ex. I'm always frustrated when [...]
10+
11+
<!-- A clear and concise description of what the problem is. -->
12+
<!-- Ex. I'm always frustrated when [...] -->
1213

1314
**Describe the solution you'd like**
14-
A clear and concise description of what you want to happen.
15+
16+
<!-- Clear and concise description of the solution you'd like to implement -->
1517

1618
**Describe alternatives you've considered**
17-
A clear and concise description of any alternative solutions or features you've considered.
19+
20+
<!-- Clear and concise description of any alternative solutions or features you've considered. -->

‎.github/workflows/main.yml‎

Lines changed: 89 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,100 @@ jobs:
3434
END { print notes; }
3535
' CHANGELOG.md)
3636
37-
# Get recent commits since last tag
37+
# Get recent commits since last tag with GitHub usernames
3838
PREVIOUS_TAG=$(git describe --tags --abbrev=0 --match "v*" 2>/dev/null || echo "")
39+
40+
# Function to get GitHub username from email
41+
get_github_username() {
42+
local email="$1"
43+
local commit_hash="$2"
44+
45+
# First try to extract username from GitHub noreply email
46+
if [[ "$email" =~ ([0-9]+\+)?([^@]+)@users\.noreply\.github\.com ]]; then
47+
echo "${BASH_REMATCH[2]}"
48+
return
49+
fi
50+
51+
# Try to get GitHub username via API using commit hash
52+
local github_user=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
53+
"https://api.github.com/repos/$GITHUB_REPOSITORY/commits/$commit_hash" | \
54+
jq -r '.author.login // empty' 2>/dev/null)
55+
56+
if [ -n "$github_user" ] && [ "$github_user" != "null" ]; then
57+
echo "$github_user"
58+
return
59+
fi
60+
61+
# Fallback: try to get user by email via API
62+
local api_user=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
63+
"https://api.github.com/search/users?q=$email+in:email" | \
64+
jq -r '.items[0].login // empty' 2>/dev/null)
65+
66+
if [ -n "$api_user" ] && [ "$api_user" != "null" ]; then
67+
echo "$api_user"
68+
else
69+
# Final fallback: use the part before @ in email
70+
echo "${email%%@*}"
71+
fi
72+
}
73+
74+
# Get ALL conventional commits, excluding merge commits to avoid duplicates
3975
if [ -z "$PREVIOUS_TAG" ]; then
40-
# If no previous tag exists, get all commits
41-
COMMITS=$(git log --pretty=format:" - %s" | grep -E "^ - (feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)" || echo "")
76+
COMMIT_DATA=$(git log --pretty=format:"%H|%ae|%s" --no-merges --grep="^\(feat\|fix\|docs\|style\|refactor\|perf\|test\|build\|ci\|chore\|revert\)")
4277
else
43-
# Get commits between previous tag and HEAD
44-
COMMITS=$(git log ${PREVIOUS_TAG}..HEAD --pretty=format:" - %s" | grep -E "^ - (feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)" || echo "")
78+
COMMIT_DATA=$(git log ${PREVIOUS_TAG}..HEAD --pretty=format:"%H|%ae|%s" --no-merges --grep="^\(feat\|fix\|docs\|style\|refactor\|perf\|test\|build\|ci\|chore\|revert\)")
79+
fi
80+
81+
# Initialize categorized commit arrays
82+
FEATURES=""
83+
BUGFIXES=""
84+
OTHER_COMMITS=""
85+
86+
# Process ALL matching commits and categorize them
87+
while IFS='|' read -r hash email subject; do
88+
[ -z "$hash" ] && continue
89+
90+
# Get full commit message for PR detection
91+
message=$(git show -s --format=%B $hash)
92+
93+
# Extract username
94+
username=$(get_github_username "$email" "$hash")
95+
96+
# Check for ANY PR reference (#number)
97+
if [[ "$message" =~ \#([0-9]+) ]]; then
98+
pr_num=" (#${BASH_REMATCH[1]})"
99+
else
100+
pr_num=""
101+
fi
102+
103+
# Categorize based on conventional commit type
104+
if [[ "$subject" =~ ^feat(\(.+\))?:* ]]; then
105+
FEATURES="${FEATURES} - ${subject}${pr_num} (@$username)\n"
106+
elif [[ "$subject" =~ ^fix(\(.+\))?:* ]]; then
107+
BUGFIXES="${BUGFIXES} - ${subject}${pr_num} (@$username)\n"
108+
else
109+
OTHER_COMMITS="${OTHER_COMMITS} - ${subject}${pr_num} (@$username)\n"
110+
fi
111+
done <<< "$COMMIT_DATA"
112+
113+
# Build categorized commits section
114+
COMMITS=""
115+
if [ -n "$FEATURES" ]; then
116+
COMMITS="${COMMITS}#### 🚀 Features\n${FEATURES}\n"
117+
fi
118+
if [ -n "$BUGFIXES" ]; then
119+
COMMITS="${COMMITS}#### 🐛 Bug Fixes\n${BUGFIXES}\n"
120+
fi
121+
if [ -n "$OTHER_COMMITS" ]; then
122+
COMMITS="${COMMITS}#### 📝 Other Commits\n${OTHER_COMMITS}\n"
45123
fi
46124
47-
# Combine CHANGELOG notes with commit messages
48-
FULL_NOTES="${NOTES}\n\n### Commits\n${COMMITS}"
125+
# Combine CHANGELOG notes with categorized commit messages
126+
if [ -n "$COMMITS" ]; then
127+
FULL_NOTES="${NOTES}\n\n### Commits\n${COMMITS}"
128+
else
129+
FULL_NOTES="${NOTES}"
130+
fi
49131
50132
# Save notes to output with correct GitHub multiline syntax
51133
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
@@ -72,10 +154,6 @@ jobs:
72154
env:
73155
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74156

75-
- name: Create zip archive
76-
if: steps.check_release.outputs.exists == 'false'
77-
run: zip -r my-unicorn-${{ steps.changelog.outputs.version }}.zip ./ -x "*.git*" ".github/*"
78-
79157
- name: Create GitHub Release
80158
if: steps.check_release.outputs.exists == 'false'
81159
uses: softprops/action-gh-release@v1
@@ -85,6 +163,5 @@ jobs:
85163
body: ${{ steps.changelog.outputs.notes }}
86164
draft: false
87165
prerelease: ${{ contains(steps.changelog.outputs.version, '-') }}
88-
files: my-unicorn-${{ steps.changelog.outputs.version }}.zip
89166
env:
90167
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[project]
22
name = 'AutoTarCompress'
3+
version = '0.3.2-beta'
34
description = 'It downloads/updates appimages via GitHub API. It also validates the appimage with SHA256 and SHA512.'
45
requires-python = ">= 3.8"
56
dependencies = [
6-
"tqdm==4.67.1",
77
]
88
maintainers = [
99
{name = "Cyber-Syntax"}

‎uv.lock‎

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)