Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix changelog generation (#648)

ologbonowiwi35351abbafc4
diff --git a/.github/scripts/generate_changelog_md.sh b/.github/scripts/generate_changelog_md.sh
index 4cccc29ba..5b6b41c11 100755
--- a/.github/scripts/generate_changelog_md.sh
+++ b/.github/scripts/generate_changelog_md.sh
@@ -1,10 +1,32 @@
-TAGS=$(git tag --sort=-creatordate)
-CURRENT_RELEASE=$(echo "$TAGS" | sed -n '1p')
-LAST_RELEASE=$(echo "$TAGS" | sed -n '2p')
+CURRENT_RELEASE=$1
-COMMITS=$(git log --oneline $LAST_RELEASE..$CURRENT_RELEASE --oneline | tr '\n' ', ' | sed 's/"/\\"/g')
+CHANGELOG_PUBLIC_PATH=screenpipe-app-tauri/public/CHANGELOG.md
-LAST_CHANGELOG=$(awk '{printf "%s\\n", $0}' screenpipe-app-tauri/public/CHANGELOG.md | sed 's/"/\\"/g')
+LAST_CHANGELOG=$(awk '/^#### \*\*Full Changelog:\*\*/{exit} {print}' $CHANGELOG_PUBLIC_PATH | awk '{printf "%s\\n", $0}' | sed 's/"/\\"/g')
+
+# Download cn binary from https://cdn.crabnebula.app/download/crabnebula/cn-cli/latest/cn_linux
+# only download it if it doesn't exist
+if ! command -v cn &> /dev/null; then
+ echo "Downloading Crab Nebula binary"
+ curl -L -o /usr/bin/cn https://cdn.crabnebula.app/download/crabnebula/cn-cli/latest/cn_linux
+ chmod +x /usr/bin/cn
+fi
+
+LAST_RELEASE=$(cn release list screenpipe --api-key $CN_API_KEY --format json | jq '.[0]')
+COMMIT_DATE_LAST_RELEASE=$(echo $LAST_RELEASE | jq '.createdAt')
+COMMIT_LAST_RELEASE=$(git log -1 --until="$COMMIT_DATE_LAST_RELEASE" --format="%H")
+
+COMMIT_CURRENT_RELEASE=$(git log -1 --format="%H")
+COMMIT_CURRENT_RELEASE=${2:-$COMMIT_CURRENT_RELEASE}
+
+# If both are equal, then there's nothing to add to the changelog
+if [ "$COMMIT_LAST_RELEASE" == "$COMMIT_CURRENT_RELEASE" ]; then
+ echo "No new commits to add to the changelog"
+ echo "CHANGELOG_GENERATED=0" >> $GITHUB_ENV
+ exit 0
+fi
+
+COMMITS=$(git log --oneline $COMMIT_LAST_RELEASE..$COMMIT_CURRENT_RELEASE --oneline | tr '\n' ', ' | sed 's/"/\\"/g')
CONTENT=$(
curl https://api.openai.com/v1/chat/completions \
@@ -15,15 +37,7 @@ CONTENT=$(
\"messages\": [
{
\"role\": \"system\",
- \"content\": \"You are an assistant specialized in generating changelogs from commits. Categorize the changes into the following sections if they apply: New Features, Improvements, Fixes, and Others.\"
- },
- {
- \"role\": \"system\",
- \"content\": \"Be concise and focus on what brings customer value. Avoid copy-pasting the commits, and instead rephrase in a 'selling' way. Do not consider things like 'deploy', 'review/merge pull requests', and other day-to-day tasks that are sort of standard for software projects.\"
- },
- {
- \"role\": \"system\",
- \"content\": \"Here is an example of it, please write it based on this version: $LAST_CHANGELOG\"
+ \"content\": \"You are a helpful assistant.\nThe user is using a product called "screenpipe" which records his screen and mics 24/7. The user ask you questions and you use his screenpipe recordings to answer him.\nYou will generate a changelog for the new screenpipe update based on a list of commits.\nHere are a some guidelines for your responses:\n- only adds to the changelog what brings clear customer value\n- categorize the changes into 'New Features', 'Improvements', 'Fixes' and 'Others'. Anything not matching these guidelines should not be included on your response\n- Deploys, merges, and software maintenance tasks which does not bring clear value to the end-user should not be included.\n\nUse the following changelog file as an example: $LAST_CHANGELOG\"
},
{
\"role\": \"user\",
@@ -35,19 +49,31 @@ CONTENT=$(
CONTENT=$(jq '.choices[0].message.content' <<< $CONTENT)
+# exit if the content is null
+if [ "$CONTENT" == "null" ]; then
+ echo "Failed to generate changelog content."
+ echo "CHANGELOG_GENERATED=0" >> $GITHUB_ENV
+ exit 1
+fi
+
# Create directory content/changelogs if it doesn't exist
mkdir -p content/changelogs
# Create a new file with the current release as the name
echo ${CONTENT//\"/} > content/changelogs/$CURRENT_RELEASE.md
+SHORT_COMMIT_LAST_RELEASE=$(echo $COMMIT_LAST_RELEASE | cut -c 1-5)
+SHORT_COMMIT_CURRENT_RELEASE=$(echo $COMMIT_CURRENT_RELEASE | cut -c 1-5)
# Add the full changelog on the end of the file
echo """
-#### **Full Changelog:** [$LAST_RELEASE...$CURRENT_RELEASE](https://github.com/mediar-ai/screenpipe/compare/$LAST_RELEASE...$CURRENT_RELEASE)
+#### **Full Changelog:** [$SHORT_COMMIT_LAST_RELEASE..$SHORT_COMMIT_CURRENT_RELEASE](https://github.com/mediar-ai/screenpipe/compare/$SHORT_COMMIT_LAST_RELEASE..$SHORT_COMMIT_CURRENT_RELEASE)
""" >> content/changelogs/$CURRENT_RELEASE.md
# Copy the new changelog to the main changelog file
-cp content/changelogs/$CURRENT_RELEASE.md screenpipe-app-tauri/public/CHANGELOG.md
+cp content/changelogs/$CURRENT_RELEASE.md $CHANGELOG_PUBLIC_PATH
# Output the current release version to be used in the workflow
echo "CURRENT_RELEASE=$CURRENT_RELEASE" >> $GITHUB_ENV
+
+# Set the flag to indicate that the changelog was generated
+echo "CHANGELOG_GENERATED=1" >> $GITHUB_ENV
diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml
index 83f117fc0..366645848 100644
--- a/.github/workflows/release-app.yml
+++ b/.github/workflows/release-app.yml
@@ -17,7 +17,7 @@ on:
required: false
version:
description: "Version to set in Cargo.toml (required if commit_hash is provided)"
- required: false
+ required: true
jobs:
generate_changelog:
@@ -32,15 +32,16 @@ jobs:
- name: Generate Changelog
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- run: .github/scripts/generate_changelog_md.sh
+ run: .github/scripts/generate_changelog_md.sh ${{ github.event.inputs.version }} ${{ github.event.inputs.commit_hash }}
- name: Commit and push changelog files
+ if: env.CHANGELOG_GENERATED == 1
run: |
git config user.name "GitHub Actions Bot"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git add .
- git commit -m "docs: add changelog for ${{ env.CURRENT_RELEASE }}"
+ git commit -m "docs: add changelog for ${{ github.event.inputs.version }}"
git pull origin main
git push origin main
diff --git a/content/changelogs/.md b/content/changelogs/.md
deleted file mode 100644
index c35f8a1cd..000000000
--- a/content/changelogs/.md
+++ /dev/null
@@ -1,4 +0,0 @@
-Thank you for providing the commits. Let's organize the changes for the upcoming version:\n\n### **New Features:**\n- **Added new dashboard customization options:** Tailor your dashboard to your needs with new customization features, allowing you to arrange and display data in a way that boosts productivity.\n\n### **Improvements:**\n- **Enhanced search functionality:** Improved the search algorithm to deliver more accurate results in less time, helping users find information efficiently.\n- **Optimized mobile responsiveness:** Ensured seamless user experience on mobile devices by optimizing responsiveness across various screen sizes.\n\n### **Fixes:**\n- **Resolved issue with user login:** Addressed a bug causing login errors for some users, ensuring smooth access to accounts without disruption.\n\n### **Others:**\n- **Updated terms of service:** Stay informed about the latest modifications to our terms of service for compliance and transparency.\n\n#### **Full Changelog:** [Link to full changelog](https://github.com/your-repo/compare/previous-version...upcoming-version)
-
-#### **Full Changelog:** [...](https://github.com/mediar-ai/screenpipe/compare/...)
-
diff --git a/screenpipe-app-tauri/public/CHANGELOG.md b/screenpipe-app-tauri/public/CHANGELOG.md
index c35f8a1cd..dcb9bac0f 100644
--- a/screenpipe-app-tauri/public/CHANGELOG.md
+++ b/screenpipe-app-tauri/public/CHANGELOG.md
@@ -1,4 +1,21 @@
-Thank you for providing the commits. Let's organize the changes for the upcoming version:\n\n### **New Features:**\n- **Added new dashboard customization options:** Tailor your dashboard to your needs with new customization features, allowing you to arrange and display data in a way that boosts productivity.\n\n### **Improvements:**\n- **Enhanced search functionality:** Improved the search algorithm to deliver more accurate results in less time, helping users find information efficiently.\n- **Optimized mobile responsiveness:** Ensured seamless user experience on mobile devices by optimizing responsiveness across various screen sizes.\n\n### **Fixes:**\n- **Resolved issue with user login:** Addressed a bug causing login errors for some users, ensuring smooth access to accounts without disruption.\n\n### **Others:**\n- **Updated terms of service:** Stay informed about the latest modifications to our terms of service for compliance and transparency.\n\n#### **Full Changelog:** [Link to full changelog](https://github.com/your-repo/compare/previous-version...upcoming-version)
+### **New Features**
+- **Intel MKL Support**: Introduced support for Intel Math Kernel Library (MKL) acceleration on macOS, Windows, and Linux, enhancing computational performance significantly.
+- **Timeline UI Revamp**: Released a new timeline user interface for improved content organization and navigation, enhancing user interaction within the app.
-#### **Full Changelog:** [...](https://github.com/mediar-ai/screenpipe/compare/...)
+### **Improvements**
+- **Brew Version Update**: Ensured compatibility and optimized performance by updating Brew to version 0.1.97 on x86_64 and aarch64 Apple Darwin systems.
+- **Search Enhancement**: Improved UI search functionality to handle scenarios with no audio path, simplifying content location in the application.
+
+### **Fixes**
+- **Documentation Clarification**: Addressed and fixed a documentation issue, providing users with accurate and clear guidance.
+- **CSS and Reddit Pipe Fixes**: Resolved layout consistency issues and corrected a minor bug in the Reddit pipe functionality for a smoother user experience.
+- **CI Pipeline Stability**: Enhanced stability in the continuous integration pipeline for more reliable testing and deployment processes.
+- **Endpoint JSON Parsing**: Fixed a bug affecting endpoint JSON parsing, resulting in improved data handling.
+
+### **Others**
+- **Database Enhancements**: Made the `audio_chunk_id` not nullable in the `audio_transcriptions` table for improved data consistency, and added a new endpoint to the database.
+- **Entelligence Removal**: Deprecated the entelligence feature, ensuring cleaner and more efficient app performance.
+- **Code Cleanup and Refactoring**: Conducted various code cleanup and refactoring tasks to enhance code quality and maintainability.
+
+#### **Full Changelog:** [v0.1.97...v0.1.98](https://github.com/mediar-ai/screenpipe/compare/v0.1.97...v0.1.98)