Skip to content

Commit 97e83e4

Browse files
🔧 chore: Update GitHub Actions workflow branch for Docker image release
- Changed the trigger branch for the automated Docker image release workflow from `sudo` to `master` in `auto-release.yml`. - This update ensures that the workflow is executed on pushes to the `master` branch, aligning with the project's branching strategy. These changes aim to streamline the release process by correctly targeting the primary branch for automation.
1 parent 7284ef4 commit 97e83e4

File tree

2 files changed

+64
-1
lines changed

2 files changed

+64
-1
lines changed

.github/workflows/auto-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: 🐳 Build and Push Docker Image 🦀
33
on:
44
push:
55
branches:
6-
- sudo
6+
- master
77

88
jobs:
99
create-release:

scripts/generate-release-notes.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import json
2+
import os
3+
import urllib.request
4+
import urllib.error
5+
6+
def generate_release_notes():
7+
try:
8+
data = json.dumps({
9+
"model": "gpt-4o-mini",
10+
"messages": [
11+
{
12+
"role": "system",
13+
"content": """You are a helpful assistant that generates release notes for a software project. Follow these guidelines:
14+
1. Analyze the provided commit messages and generate a comprehensive summary
15+
2. Group changes by type (features, fixes, improvements etc)
16+
3. Include technical details and implementation specifics
17+
4. Add relevant code snippets in markdown code blocks
18+
5. Create mermaid diagrams to visualize architecture/flow changes
19+
6. Use emojis liberally to add personality
20+
7. Keep a fun, engaging tone while being technically accurate
21+
8. Highlight breaking changes and migration steps if any
22+
9. Add deployment instructions if relevant
23+
10. Include performance impact notes
24+
11. List any new dependencies introduced
25+
12. Note API changes and backwards compatibility
26+
13. Add security advisory if applicable
27+
14. Mention contributors and acknowledgements
28+
15. Format everything in GitHub-flavored markdown
29+
30+
Only return the formatted release notes, no other text."""
31+
},
32+
{
33+
"role": "user",
34+
"content": f"Generate detailed release notes with the following information:\n\nCommit History: {os.environ.get('COMMITS')}\nRepository: {os.environ.get('GITHUB_REPOSITORY')}\nRelease Name: {os.environ.get('DOCKERLIKE_RELEASE_NAME')}\nVersion: {os.environ.get('NEW_VERSION')}\n\nPlease analyze the commits and generate comprehensive release notes following the system guidelines."
35+
}
36+
]
37+
})
38+
39+
url = os.environ.get("OPENAI_BASE_URL") + "/chat/completions"
40+
headers = {
41+
"Content-Type": "application/json",
42+
"Authorization": f"Bearer {os.environ.get('OPENAI_API_KEY')}"
43+
}
44+
45+
req = urllib.request.Request(
46+
url,
47+
data=data.encode("utf-8"),
48+
headers=headers,
49+
method="POST"
50+
)
51+
52+
with urllib.request.urlopen(req) as response:
53+
response_data = response.read()
54+
content = json.loads(response_data)["choices"][0]["message"]["content"]
55+
with open("release_notes.md", "w") as f:
56+
f.write(content)
57+
58+
except Exception as error:
59+
print(f"Error: {error}")
60+
exit(1)
61+
62+
if __name__ == "__main__":
63+
generate_release_notes()

0 commit comments

Comments
 (0)