Skip to content

Commit 8c0b9db

Browse files
Merge pull request #80 from vintasoftware/ft/changelog
Ft/changelog
2 parents 6df11c5 + 0d21b76 commit 8c0b9db

File tree

5 files changed

+68
-3
lines changed

5 files changed

+68
-3
lines changed

.github/workflows/release.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Release draft creation
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Version of the release"
8+
required: true
9+
type: number
10+
11+
jobs:
12+
release:
13+
name: Release
14+
15+
runs-on: ubuntu-latest
16+
17+
permissions:
18+
contents: write
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Extract changelog for version
25+
run: |
26+
VERSION=${{ github.event.inputs.version }}
27+
28+
# Extract changelog for version
29+
CHANGELOG=$(awk -v version="$VERSION" 'BEGIN{RS="## "; FS="\n"} $0 ~ version {print "## "$0}' CHANGELOG.md)
30+
31+
# Remove the first line (version title)
32+
CHANGELOG=$(echo "$CHANGELOG" | sed '1d')
33+
34+
# Verify if changelog was found
35+
if [ -z "$CHANGELOG" ]; then
36+
echo "Changelog for version $VERSION not found"
37+
exit 1
38+
fi
39+
40+
# Set output
41+
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
42+
echo "$CHANGELOG" >> $GITHUB_ENV
43+
echo "EOF" >> $GITHUB_ENV
44+
45+
- name: Create GitHub Release Draft
46+
uses: softprops/action-gh-release@v2
47+
with:
48+
tag_name: ${{ github.event.inputs.version }}
49+
name: ${{ github.event.inputs.version }}
50+
body: ${{ env.CHANGELOG }}
51+
draft: true
52+
prerelease: false
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
56+
- name: Summary
57+
run: |
58+
echo "## 🚀 Release Summary" >> $GITHUB_STEP_SUMMARY
59+
echo "Release draft created for version ${{ github.event.inputs.version }}." >> $GITHUB_STEP_SUMMARY
60+
echo "Visit the [Releases section](https://github.com/vintasoftware/nextjs-fastapi-template/releases) to review and publish the release." >> $GITHUB_STEP_SUMMARY
61+
echo "Once the draft is published, another action will automatically be triggered to publish the packages." >> $GITHUB_STEP_SUMMARY

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ frontend TypeScript client, `nextjs-frontend`.
77
The backend and the frontend are versioned together, that is, they have the same version number.
88
When you update the backend, you should also update the frontend to the same version.
99

10+
## 0.0.2 <small>March 12, 2025</small> {id="0.0.2"}
11+
12+
- Generate release draft using github actions
13+
1014
## 0.0.1 <small>March 12, 2025</small> {id="0.0.1"}
1115

1216
- Initial release

fastapi_backend/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "app"
3-
version = "0.0.1"
3+
version = "0.0.2"
44
description = ""
55
authors = [{ name = "Anderson Resende", email = "[email protected]" }]
66
requires-python = ">=3.12,<3.13"

fastapi_backend/uv.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nextjs-frontend/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nextjs-frontend",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"private": true,
55
"scripts": {
66
"dev": "next dev",

0 commit comments

Comments
 (0)