Automate manifest.json version updates during release #9

Merged
deluan merged 6 commits from claude/automate-manifest-versioning-MJ9WM into main 2026-02-07 18:17:09 -07:00
deluan commented 2026-02-07 15:49:54 -07:00 (Migrated from github.com)

Automate version management during releases so the packaged artifact
always carries the correct version in manifest.json.

Changes

  • New create-release.yml workflow — a workflow_dispatch workflow
    that can be triggered from the GitHub Actions UI. It validates the
    version format, checks for duplicate tags, runs tests, updates
    manifest.json, commits, tags, and pushes — which then triggers the
    existing release workflow to build and publish the artifact.

  • CI guard in release.yml — fails early if the tag and
    manifest.json versions ever diverge.

  • Simplified make release — instead of running the release process
    locally, it now just validates the version and triggers the
    create-release.yml workflow via gh workflow run.

Automate version management during releases so the packaged artifact always carries the correct version in `manifest.json`. ### Changes - **New `create-release.yml` workflow** — a `workflow_dispatch` workflow that can be triggered from the GitHub Actions UI. It validates the version format, checks for duplicate tags, runs tests, updates `manifest.json`, commits, tags, and pushes — which then triggers the existing release workflow to build and publish the artifact. - **CI guard in `release.yml`** — fails early if the tag and `manifest.json` versions ever diverge. - **Simplified `make release`** — instead of running the release process locally, it now just validates the version and triggers the `create-release.yml` workflow via `gh workflow run`.
gemini-code-assist[bot] commented 2026-02-07 15:50:05 -07:00 (Migrated from github.com)

Summary of Changes

Hello @deluan, I'm Gemini Code Assist1 ! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the release automation by integrating the manifest.json version update directly into the make release command. This ensures that the manifest.json file is always correctly versioned and committed before a release tag is created, streamlining the release process and preventing potential version mismatches in deployed artifacts. It also sets the stage for a CI check to enforce version consistency.

Highlights

  • Automated Version Update: The make release command now automatically updates the version field in manifest.json to match the release version (V) provided.
  • Version Commit Before Tagging: The updated manifest.json with the correct version is now committed as part of the release process, ensuring the packaged artifact always reflects the intended version.
  • CI Guard for Version Divergence: A CI guard is intended to be added to the release workflow to prevent discrepancies between the tag and manifest versions, failing early if they diverge (though this specific CI change is not part of the provided patch).
  • Git Push Target Update: The git push command in the release process now pushes to origin main in addition to the tag.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • Makefile
    • Added a sed command to automatically update the version field in manifest.json using the V variable.
    • Included git add manifest.json and git commit -m "Release v${V}" to stage and commit the updated manifest before tagging.
    • Modified the git push command to push to origin main in addition to the release tag.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/create-release.yml
    • .github/workflows/release.yml
Activity
  • No human activity (comments, reviews, or progress updates) has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩︎

## Summary of Changes Hello @deluan, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the release automation by integrating the `manifest.json` version update directly into the `make release` command. This ensures that the `manifest.json` file is always correctly versioned and committed before a release tag is created, streamlining the release process and preventing potential version mismatches in deployed artifacts. It also sets the stage for a CI check to enforce version consistency. ### Highlights * **Automated Version Update**: The `make release` command now automatically updates the `version` field in `manifest.json` to match the release version (`V`) provided. * **Version Commit Before Tagging**: The updated `manifest.json` with the correct version is now committed as part of the release process, ensuring the packaged artifact always reflects the intended version. * **CI Guard for Version Divergence**: A CI guard is intended to be added to the release workflow to prevent discrepancies between the tag and manifest versions, failing early if they diverge (though this specific CI change is not part of the provided patch). * **Git Push Target Update**: The `git push` command in the release process now pushes to `origin main` in addition to the tag. 🧠 **New Feature in Public Preview:** You can now enable **Memory** to help **Gemini Code Assist** learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. **Click [here](https://codeassist.google/code-review/login) to enable Memory in your admin console.** <details> <summary><b>Changelog</b></summary> * **Makefile** * Added a `sed` command to automatically update the `version` field in `manifest.json` using the `V` variable. * Included `git add manifest.json` and `git commit -m "Release v${V}"` to stage and commit the updated manifest before tagging. * Modified the `git push` command to push to `origin main` in addition to the release tag. </details> <details> <summary><b>Ignored Files</b></summary> * **Ignored by pattern:** `.github/workflows/**` (2) * .github/workflows/create-release.yml * .github/workflows/release.yml </details> <details> <summary><b>Activity</b></summary> * No human activity (comments, reviews, or progress updates) has been recorded on this pull request yet. </details> <details> <summary><b>Using Gemini Code Assist</b></summary> <br> The full guide for Gemini Code Assist can be found on our [documentation page](https://developers.google.com/gemini-code-assist/docs/review-github-code), here are some quick tips. <b>Invoking Gemini</b> You can request assistance from Gemini at any point by creating a comment using either `/gemini <command>` or `@gemini-code-assist <command>`. Below is a summary of the supported commands on the current page. Feature | Command | Description --- | --- | --- Code Review | `/gemini review` | Performs a code review for the current pull request in its current state. Pull Request Summary | `/gemini summary` | Provides a summary of the current pull request in its current state. Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments. Help | `/gemini help` | Displays a list of available commands. <b>Customization</b> To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a `.gemini/` folder in the base of the repository. Detailed instructions can be found [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github). <b>Limitations & Feedback</b> Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up [here](https://google.qualtrics.com/jfe/form/SV_2cyuGuTWsEw84yG). <b>You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the [Gemini Code Assist IDE Extension](https://cloud.google.com/products/gemini/code-assist).</b> </details> [^1]: Review the [Privacy Notices](https://policies.google.com/privacy), [Generative AI Prohibited Use Policy](https://policies.google.com/terms/generative-ai/use-policy), [Terms of Service](https://policies.google.com/terms), and learn how to configure Gemini Code Assist in GitHub [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github). Gemini can make mistakes, so double check it and [use code with caution](https://support.google.com/legal/answer/13505487).
github-actions[bot] commented 2026-02-07 15:50:46 -07:00 (Migrated from github.com)

Download the plugin for this PR: discord-rich-presence.zip

Built from 63ab3ec57e on 2026-02-08T01:16:25Z

Download the plugin for this PR: [discord-rich-presence.zip](https://nightly.link/navidrome/discord-rich-presence-plugin/actions/runs/21789971562/discord-rich-presence.zip) Built from 63ab3ec57e82ae863895ae2a2fc79abcb1d4336c on 2026-02-08T01:16:25Z <!-- Sticky Pull Request Comment -->
gemini-code-assist[bot] (Migrated from github.com) reviewed 2026-02-07 15:50:48 -07:00
gemini-code-assist[bot] (Migrated from github.com) left a comment

Code Review

This pull request automates the version update in manifest.json during the release process, which is a great improvement for consistency. My review points out a critical bug in the implementation that would prevent it from working as expected and provides a fix. With this correction, the change will be a valuable addition to the release workflow.

## Code Review This pull request automates the version update in `manifest.json` during the release process, which is a great improvement for consistency. My review points out a critical bug in the implementation that would prevent it from working as expected and provides a fix. With this correction, the change will be a valuable addition to the release workflow.
@@ -16,3 +17,3 @@
rm -f $(WASM_FILE) $(PLUGIN_NAME).ndp
release: test
release:
gemini-code-assist[bot] (Migrated from github.com) commented 2026-02-07 15:50:48 -07:00

critical

The shell variable ${V} will not be expanded within single quotes. This will result in the literal string "${V}" being written to manifest.json instead of the version number. To fix this, you should use double quotes for the sed expression and escape the inner double quotes.

Additionally, sed -i behaves differently on GNU/Linux versus macOS/BSD systems. For better portability, you might consider a different approach in the future, but fixing the variable expansion is the critical part.

@sed -i "s/\"version\": *\"[^\"]*\"/\"version\": \"${V}\"/" manifest.json
![critical](https://www.gstatic.com/codereviewagent/critical.svg) The shell variable `${V}` will not be expanded within single quotes. This will result in the literal string `"${V}"` being written to `manifest.json` instead of the version number. To fix this, you should use double quotes for the `sed` expression and escape the inner double quotes. Additionally, `sed -i` behaves differently on GNU/Linux versus macOS/BSD systems. For better portability, you might consider a different approach in the future, but fixing the variable expansion is the critical part. ``` @sed -i "s/\"version\": *\"[^\"]*\"/\"version\": \"${V}\"/" manifest.json ```
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2026-02-07 15:53:33 -07:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Pull request overview

This PR updates the release process to ensure manifest.json is version-bumped and committed as part of creating a release tag, and adds CI validation to prevent tag/manifest version drift.

Changes:

  • Update make release to rewrite manifest.json’s version, commit it, then tag and push.
  • Add a release workflow guard that fails if the pushed tag version doesn’t match manifest.json.
  • Introduce a manually-triggered workflow to create a release (tests → bump manifest → commit/tag/push).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
Makefile Adds manifest version update + commit during make release, and pushes main + tag.
.github/workflows/release.yml Adds a guard step to compare tag version vs manifest.json version.
.github/workflows/create-release.yml New workflow_dispatch flow to automate bump/commit/tag/push for releases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

## Pull request overview This PR updates the release process to ensure `manifest.json` is version-bumped and committed as part of creating a release tag, and adds CI validation to prevent tag/manifest version drift. **Changes:** - Update `make release` to rewrite `manifest.json`’s `version`, commit it, then tag and push. - Add a release workflow guard that fails if the pushed tag version doesn’t match `manifest.json`. - Introduce a manually-triggered workflow to create a release (tests → bump manifest → commit/tag/push). ### Reviewed changes Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments. | File | Description | | ---- | ----------- | | Makefile | Adds manifest version update + commit during `make release`, and pushes `main` + tag. | | .github/workflows/release.yml | Adds a guard step to compare tag version vs `manifest.json` version. | | .github/workflows/create-release.yml | New workflow_dispatch flow to automate bump/commit/tag/push for releases. | --- 💡 <a href="/navidrome/discord-rich-presence-plugin/new/main/.github/instructions?filename=*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.
@@ -0,0 +1,63 @@
name: Create Release
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2026-02-07 15:53:34 -07:00

git commit -m "Release v..." will fail the workflow if manifest.json already contains the requested version (nothing to commit), which can happen if the workflow is re-run or the input matches the current version. Consider guarding with a diff check and skipping the commit when unchanged, or adding --allow-empty if an empty release commit is acceptable.

                  git commit --allow-empty -m "Release v${{ inputs.version }}"
`git commit -m "Release v..."` will fail the workflow if `manifest.json` already contains the requested version (nothing to commit), which can happen if the workflow is re-run or the input matches the current version. Consider guarding with a diff check and skipping the commit when unchanged, or adding `--allow-empty` if an empty release commit is acceptable. ```suggestion git commit --allow-empty -m "Release v${{ inputs.version }}" ```
@@ -0,0 +35,4 @@
if git ls-remote --tags origin "refs/tags/v${VERSION}" | grep -q .; then
echo "::error::Tag v${VERSION} already exists"
exit 1
fi
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2026-02-07 15:53:33 -07:00

This step runs git ls-remote ... origin ... before the repository is checked out, so it will fail with “not a git repository” / no origin remote. Move the “Check out code” step before this, or use the GitHub API to check for an existing tag.

This step runs `git ls-remote ... origin ...` before the repository is checked out, so it will fail with “not a git repository” / no `origin` remote. Move the “Check out code” step before this, or use the GitHub API to check for an existing tag.
@@ -16,6 +16,15 @@ jobs:
- name: Check out code
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2026-02-07 15:53:33 -07:00

MANIFEST_VERSION is extracted via grep -oP with a PCRE-specific \K, which is brittle for JSON (and can fail if GNU grep isn’t built with PCRE support or if formatting changes). Consider parsing manifest.json with a JSON-aware tool (e.g., jq -r .version manifest.json or a short Python snippet) to make this guard reliable.

                  MANIFEST_VERSION=$(jq -r '.version' manifest.json)
`MANIFEST_VERSION` is extracted via `grep -oP` with a PCRE-specific `\K`, which is brittle for JSON (and can fail if GNU grep isn’t built with PCRE support or if formatting changes). Consider parsing `manifest.json` with a JSON-aware tool (e.g., `jq -r .version manifest.json` or a short Python snippet) to make this guard reliable. ```suggestion MANIFEST_VERSION=$(jq -r '.version' manifest.json) ```
@@ -16,3 +17,3 @@
rm -f $(WASM_FILE) $(PLUGIN_NAME).ndp
release: test
release:
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2026-02-07 15:53:32 -07:00

git push origin main v${V} pushes the local main ref, but the release commit is created on the current checked-out branch. If the user runs make release from a branch other than main, the tag will point to the release commit but origin/main will not receive that commit (and could even push an outdated local main). Consider either enforcing/releases from main (fail if not on main and git pull --ff-only), or push HEAD:main alongside the tag so the commit you just made is what gets pushed.

`git push origin main v${V}` pushes the local `main` ref, but the release commit is created on the *current* checked-out branch. If the user runs `make release` from a branch other than `main`, the tag will point to the release commit but `origin/main` will not receive that commit (and could even push an outdated local `main`). Consider either enforcing/releases from `main` (fail if not on `main` and `git pull --ff-only`), or push `HEAD:main` alongside the tag so the commit you just made is what gets pushed.
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2026-02-07 15:53:33 -07:00

The release recipe uses bash-only syntax ([[ ... ]] / =~) and GNU sed -i semantics. Since the Makefile doesn’t set SHELL := bash, this target can fail on systems where /bin/sh is dash (common on Ubuntu) or where sed -i requires a backup suffix (macOS/BSD). Consider setting SHELL := /usr/bin/env bash (or rewriting to POSIX sh) and using a portable in-place edit approach for manifest.json.

The `release` recipe uses bash-only syntax (`[[ ... ]]` / `=~`) and GNU `sed -i` semantics. Since the Makefile doesn’t set `SHELL := bash`, this target can fail on systems where `/bin/sh` is `dash` (common on Ubuntu) or where `sed -i` requires a backup suffix (macOS/BSD). Consider setting `SHELL := /usr/bin/env bash` (or rewriting to POSIX sh) and using a portable in-place edit approach for `manifest.json`.
Sign in to join this conversation.