From 92c4efb082edc2712e2c6067260315f3cd01dea8 Mon Sep 17 00:00:00 2001 From: Violet Caulfield <42452695+anultravioletaurora@users.noreply.github.com> Date: Sun, 1 Jun 2025 08:53:48 -0500 Subject: [PATCH] Improve Release Notes (#394) * update ai release notes job - increase gradle memory limit --- .github/workflows/publish-beta.yml | 102 +++++++++++++++++++---------- android/gradle.properties | 2 +- 2 files changed, 69 insertions(+), 35 deletions(-) diff --git a/.github/workflows/publish-beta.yml b/.github/workflows/publish-beta.yml index 873a41cf..0d522046 100644 --- a/.github/workflows/publish-beta.yml +++ b/.github/workflows/publish-beta.yml @@ -24,6 +24,71 @@ on: - major jobs: + generate-release-notes: + runs-on: ubuntu-latest + outputs: + release_notes: ${{ steps.ai_release_notes.outputs.release_notes }} + steps: + - name: 🛒 Checkout + uses: actions/checkout@v4 + with: + token: ${{ secrets.SIGNING_REPO_PAT }} + + - name: 🧠 Collect commit messages + id: commits + run: | + git fetch --quiet origin main + + # Find common ancestor between HEAD and origin/main + BASE_SHA=$(git merge-base origin/main HEAD) + + # Get all non-merge commit messages since that base + COMMIT_MESSAGES=$(git log --no-merges --pretty=format:"- %s" "${BASE_SHA}..HEAD") + + # Print them to the GitHub Actions output + { + echo "messages<> "$GITHUB_OUTPUT" + + + - name: ✨ Generate release notes with ChatGPT + id: ai_release_notes + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + run: | + MESSAGES=$(cat <> $GITHUB_OUTPUT + echo "$RELEASE_BODY" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + publish-android: if: ${{ github.event.inputs['build-platform'] == 'Android' || github.event.inputs['build-platform'] == 'Both' }} runs-on: ubuntu-latest @@ -95,6 +160,7 @@ jobs: runs-on: macos-15 outputs: version: ${{ steps.setver.outputs.version }} + needs: [generate-release-notes] steps: - name: 🛒 Checkout @@ -106,8 +172,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 - - - name: 🍎 Run yarn init-ios:new-arch run: yarn init-ios:new-arch @@ -161,7 +225,7 @@ jobs: path: ./ios/Jellify.ipa finalize-release: - needs: [publish-android, publish-ios] + needs: [publish-android, publish-iOS, generate-release-notes] runs-on: ubuntu-latest steps: - name: 🛒 Checkout Repo @@ -216,36 +280,6 @@ jobs: git pull origin main git push origin main - - name: 🧠 Get commit messages for this release - id: commits - run: | - echo "messages<> $GITHUB_OUTPUT - git log --pretty=format:"- %s" $(git describe --tags --abbrev=0)..HEAD >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - - name: ✨ Generate Release Notes with ChatGPT - id: ai_release_notes - run: | - RELEASE_BODY=$(curl -s https://api.openai.com/v1/chat/completions \ - -H "Authorization: Bearer ${{ secrets.OPENAI_API_KEY }}" \ - -H "Content-Type: application/json" \ - -d '{ - "model": "gpt-4", - "messages": [ - {"role": "system", "content": "You are a helpful assistant that writes concise and friendly mobile app release notes from commit messages."}, - {"role": "system", "content": "You are writing release notes for a mobile app called Jellify. The app is a music player that allows you to play music from your library and stream music from the internet."}, - {"role": "system", "content": "You are a music enthusiast and you love music related puns and jokes. You can lightly add a pun or joke to the release notes if it's relevant to the release."}, - {"role": "system", "content": "Release notes should be concise and helpful to any user of the app - regardless of their technical knowledge."}, - {"role": "system", "content": "Release notes should be written in a way that is easy to understand and follow."}, - {"role": "user", "content": "Write a release summary based on these commit messages:\n'"${{ steps.commits.outputs.messages }}"'"} - ], - "temperature": 0.7 - }' | jq -r '.choices[0].message.content') - - echo "release_notes<> $GITHUB_OUTPUT - echo "$RELEASE_BODY" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - name: 🎉 Create Unified GitHub Release uses: ncipollo/release-action@v1 id: githubRelease @@ -253,7 +287,7 @@ jobs: artifacts: ./final-artifacts/* name: ${{ needs.publish-ios.outputs.version || needs.publish-android.outputs.version }} tag: ${{ needs.publish-ios.outputs.version || needs.publish-android.outputs.version }} - body: ${{ steps.ai_release_notes.outputs.release_notes }} + body: ${{ needs.generate-release-notes.outputs.release_notes }} prerelease: true token: ${{ secrets.SIGNING_REPO_PAT }} diff --git a/android/gradle.properties b/android/gradle.properties index 3e878eab..e286da59 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -10,7 +10,7 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m -org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=512m +org.gradle.jvmargs=-Xmx8192m -XX:MaxMetaspaceSize=512m # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit