diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml index 14926fd..f886d61 100644 --- a/.github/workflows/beta-release.yml +++ b/.github/workflows/beta-release.yml @@ -28,6 +28,14 @@ jobs: VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')" VERSION_WITH_BUILDNUMBER="$VERSION-beta+$BUILDNUMBER" echo "betaVersion=$VERSION-beta" >> $GITHUB_ENV + + # Read before the version gets the beta suffix: the changelog section is named after the plain version + RELEASE_NOTE="./build/tmp/beta_release_note.txt" + mkdir -p "$(dirname "$RELEASE_NOTE")" + ./gradlew getChangelog --project-version "$VERSION" --no-header --console=plain -q > "$RELEASE_NOTE" 2>/dev/null \ + || ./gradlew getChangelog --unreleased --no-header --console=plain -q > "$RELEASE_NOTE" + echo "releaseNote=$RELEASE_NOTE" >> $GITHUB_ENV + sed -i "/pluginVersion = / s/ = .*/ = $VERSION_WITH_BUILDNUMBER/" gradle.properties echo "Version: $VERSION_WITH_BUILDNUMBER" @@ -70,7 +78,7 @@ jobs: --target "${{ github.head_ref }}" \ --title "v${{ env.betaVersion }}" \ --prerelease \ - --notes "This is a prerelease of the next version of the plugin. Checkout the pull request from master to release for the changelog." + --notes-file "${{ env.releaseNote }}" # Upload artifact as a release asset - name: Upload Release Asset diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7c1dd85..133a429 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,8 +17,10 @@ on: # Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g. for dependabot pull requests) push: branches: [main] - # Trigger the workflow on any pull request + # Trigger the workflow on any pull request, except the ones to 'release': their head is main, whose push build + # already runs for the same commit and shows up in the pull request pull_request: + branches-ignore: [release] jobs: @@ -69,8 +71,10 @@ jobs: PROPERTIES="$(./gradlew properties --console=plain -q)" VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')" NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')" - CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)" - + # The section of the version, which the "Prepare release" workflow creates, or the unreleased one without it + CHANGELOG="$(./gradlew getChangelog --project-version "$VERSION" --no-header --console=plain -q 2>/dev/null \ + || ./gradlew getChangelog --unreleased --no-header --console=plain -q)" + echo "version=$VERSION" >> $GITHUB_OUTPUT echo "name=$NAME" >> $GITHUB_OUTPUT diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml new file mode 100644 index 0000000..e49ebf9 --- /dev/null +++ b/.github/workflows/prepare-release.yml @@ -0,0 +1,83 @@ +# GitHub Actions Workflow that prepares a release: it raises the pluginVersion, moves the Unreleased section of the +# changelog under that version and opens a pull request to main with both. Once it is merged, the Build workflow +# creates the release draft with the notes of that version, and the main -> release pull request publishes the beta. +# Started by hand from the Actions tab. + +name: Prepare Release +on: + workflow_dispatch: + inputs: + version: + description: Version to release, e.g. 0.6.2 + required: true + type: string + +jobs: + + prepare-release: + name: Prepare Release + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + + # Check out current repository + - name: Fetch Sources + uses: actions/checkout@v7 + with: + ref: main + + # Setup Java 21 environment for the next steps + - name: Setup Java + uses: actions/setup-java@v6 + with: + distribution: zulu + java-version: 21 + + # Setup Gradle + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v6 + with: + gradle-home-cache-cleanup: true + + # Raise the version and move the Unreleased section under it + - name: Patch Version and Changelog + env: + VERSION: ${{ inputs.version }} + run: | + if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "::error::'$VERSION' is not a version like 0.6.2" + exit 1 + fi + + UNRELEASED="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)" + if [ -z "$(echo "$UNRELEASED" | tr -d '[:space:]')" ]; then + echo "::error::The Unreleased section of CHANGELOG.md is empty" + exit 1 + fi + + sed -i "/pluginVersion = / s/ = .*/ = $VERSION/" gradle.properties + ./gradlew patchChangelog + + # Open the pull request to main. It is created with the GITHUB_TOKEN, so no workflows run for it + - name: Create Pull Request + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VERSION: ${{ inputs.version }} + run: | + BRANCH="prepare-release-v$VERSION" + + git config user.email "action@github.com" + git config user.name "GitHub Action" + + git checkout -b "$BRANCH" + git commit -m "Prepare the $VERSION release" gradle.properties CHANGELOG.md + git push --set-upstream origin "$BRANCH" + + mkdir -p build/tmp + ./gradlew getChangelog --project-version "$VERSION" --no-header --console=plain -q > build/tmp/release_note.txt + gh pr create \ + --base main \ + --title "Prepare the $VERSION release" \ + --body-file build/tmp/release_note.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c6cc27..b943afb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,17 +4,23 @@ ## [Unreleased] -## [0.6.1] +## [0.6.1] - 2026-10-13 + ### Fixed + +- "What's new" on the Marketplace showed the changes of the previous version, 0.6.0 listed the ones of 0.5.10 - An IllegalStateException "Must not perform modifications while holding read lock/iterating" was thrown when a gutter icon was redrawn ([#112](https://github.com/0verEngineer/InlineProblems/issues/112)) ## [0.6.0] + ### Added + - Regex and glob support in the problem filter list: an entry starting with `re:` is a regular expression, an entry containing `*` or `?` is a glob, everything else still matches the beginning of the problem text ([#94](https://github.com/0verEngineer/InlineProblems/issues/94)) - Problems are redrawn when the color scheme or the look and feel changes, so they follow an automatic switch between light and dark theme ([#61](https://github.com/0verEngineer/InlineProblems/issues/61)) - The problem line length offset can be configured in the settings, the setting existed but was never read ### Changed + - Platform baseline raised from 2021.2.4 to 2025.1, since-build 251, sources target Java 21 - Build migrated to the IntelliJ Platform Gradle Plugin 2.x and Gradle 9.7.1, so the project builds with current JDKs again - Large files got considerably faster ([#96](https://github.com/0verEngineer/InlineProblems/issues/96)). Measured on a file with 1268 problems: a full daemon run went from ~5000 inlay removals plus ~5000 additions down to none, a single edit from ~2000 inlay operations down to 3, and the initial draw from 149 ms to 81 ms @@ -25,6 +31,7 @@ - UI test setup ported from runIdeForUiTests to testIdeUi and the IntelliJ Starter framework ### Fixed + - The HighlightProblemListener never reported anything, and "Show only highest severity per line" removed the problems instead of drawing them, both because of an inverted check - Severities configured under "Additional severities" for infos were rendered as weak warnings - With more than one project open, every scan removed and redrew all problems of the other projects @@ -40,73 +47,100 @@ - Three settings checkboxes were not initialized from the stored state ## [0.5.10] + ### Fixed + - Fixed max lines feature 0-ignore logic (problems not appearing) - Fixed and improved the problem reset and refresh after using actions (keyboard shortcuts) to enable/disable severity levels or the whole plugin functionality ## [0.5.9] + ### Changed + - Added a max lines feature to exclude big files - Added a max problems per line feature ## [0.5.8] + ### Fixed + - Fixed settings not opening with non default locales ## [0.5.7] + ### Changed + - Added feature to enable and disable all problems with a keybind (thanks to khopland) - Added feature to hover and click in a problem to get the fix context window (thanks to khopland) ## [0.5.6] + ### Changed + - Added 2 settings options to disable HTML stripping and XML unescaping + ### Fixed + - Generics in error messages were stripped because of the HTML stripping ## [0.5.5] + ### Changed + - Try to use unlimited until-build for future IDEA Releases ## [0.5.4] + ### Changed + - Use unlimited until-build for future IDEA Releases ## [0.5.3] + ### Added + - Ability to blacklist file extensions so that the plugin will not show anything on blacklisted files ## [0.5.2] + ### Added + - Compability with 2024.1 ## [0.5.1] + ### Fixed + - SettingsBundle missing default (Settings not working with non english os language) - Prevents gutter icon readding when the line of the problem does not exist anymore ## [0.5.0] ### Added + - Gutter icon support (disabled by default) - Notification when a Unity project is opened in Rider, and it switches to the ManualScan listener - Chinese translation (thanks to kuweiguge) ### Fixed + - AlreadyDisposedException in HighlightProblemListener ## [0.4.3] ### Added + - Some performance improvements - Description for the listeners in the settings - Configurable delay for the manual scan listener - Support for new EAP versions ### Changed + - MarkupModelListener is now the default listener ### Fixed + - Some possible null pointer exceptions - invokeLater queuing issue of MarkupModelListener if used with the only one problem per line feature - Cache of activeProblems is now thread safe @@ -115,45 +149,54 @@ ## [0.4.2] ### Added + - Custom severity values (comma separated list) for the different severity levels ### Fixed + - Possible index out of bounds exception - Flicker issued with the new only show highest severity per line feature ## [0.4.0] - 2023-04-08 ### Added + - Problems are now sorted by severity - Setting to show only the problem with the highest severity per line - Bold and italic font styles for problem labels ### Fixed + - Problem label boxes were drawn to high and sometimes a line did not disappear because it was drawn in the line above - AlreadyDisposedException in HighlightProblemListener ## [0.3.3] - 2023-02-18 ### Added + - Font delta setting to decrease the problem label size ### Fixed + - Settings refresh not reliable ## [0.3.2] - 2023-02-04 ### Fixed + - Deprecated function usage ## [0.3.1] - 2023-02-04 ### Added + - MarkupModelListener for problem collecting - Reset & rescan of all problems on settings change - Adding ManualScan per delay of 250ms between finishing of the previous scan and starting a new one for problem collecting - Support for Unity Engine projects in Rider (it will switch to the ManualScan listener while Unity projects are open) ### Fixed + - SettingsState serialization issue (error on start) - Settings always modified - Invalid problems were shown @@ -163,6 +206,7 @@ ## [0.2.1] - 2023-01-12 ### Fixed + - Empty problems shown - Index out of bounds error - Versioning @@ -170,29 +214,35 @@ ## [0.2.0] - 2023-01-08 ### Added + - Option to change between editor and tooltip font - Fallback font loading - Option for filled inlay boxes ### Fixed + - Label size calculation - Spacing between inlay boxes ## [0.1.2] - 2023-01-03 ### Added + - Reload after settings change ### Fixed + - Problem filtering - Removal / flicker of problems in dual pane mode ## [0.1.1] - 2022-12-19 ### Changed + - Default settings improved ### Fixed + - Removal of labels - Duplicated problems shown - Severity checks fix @@ -200,17 +250,31 @@ ## [0.1.0] ### Added + - Initial release with basic functionality -[Unreleased]: https://github.com/0verEngineer/InlineProblems/compare/v0.4.0...HEAD +[Unreleased]: https://github.com/0verEngineer/InlineProblems/compare/v0.6.1...HEAD +[0.6.1]: https://github.com/0verEngineer/InlineProblems/compare/v0.6.0...v0.6.1 +[0.6.0]: https://github.com/0verEngineer/InlineProblems/compare/v0.5.10...v0.6.0 +[0.5.10]: https://github.com/0verEngineer/InlineProblems/compare/v0.5.9...v0.5.10 +[0.5.9]: https://github.com/0verEngineer/InlineProblems/compare/v0.5.8...v0.5.9 +[0.5.8]: https://github.com/0verEngineer/InlineProblems/compare/v0.5.7...v0.5.8 +[0.5.7]: https://github.com/0verEngineer/InlineProblems/compare/v0.5.6...v0.5.7 +[0.5.6]: https://github.com/0verEngineer/InlineProblems/compare/v0.5.5...v0.5.6 +[0.5.5]: https://github.com/0verEngineer/InlineProblems/compare/v0.5.4...v0.5.5 +[0.5.4]: https://github.com/0verEngineer/InlineProblems/compare/v0.5.3...v0.5.4 +[0.5.3]: https://github.com/0verEngineer/InlineProblems/compare/v0.5.2...v0.5.3 +[0.5.2]: https://github.com/0verEngineer/InlineProblems/compare/v0.5.1...v0.5.2 +[0.5.1]: https://github.com/0verEngineer/InlineProblems/compare/v0.5.0...v0.5.1 +[0.5.0]: https://github.com/0verEngineer/InlineProblems/compare/v0.4.3...v0.5.0 [0.4.3]: https://github.com/0verEngineer/InlineProblems/compare/v0.4.2...v0.4.3 [0.4.2]: https://github.com/0verEngineer/InlineProblems/compare/v0.4.0...v0.4.2 [0.4.0]: https://github.com/0verEngineer/InlineProblems/compare/v0.3.3...v0.4.0 -[0.3.3]: https://github.com/0verEngineer/InlineProblems/compare/0.3.2...v0.3.3 -[0.3.2]: https://github.com/0verEngineer/InlineProblems/compare/0.3.1...0.3.2 -[0.3.1]: https://github.com/0verEngineer/InlineProblems/compare/0.2.1...0.3.1 -[0.2.1]: https://github.com/0verEngineer/InlineProblems/compare/0.2.0...0.2.1 -[0.2.0]: https://github.com/0verEngineer/InlineProblems/compare/0.1.2...0.2.0 -[0.1.2]: https://github.com/0verEngineer/InlineProblems/compare/0.1.1...0.1.2 -[0.1.1]: https://github.com/0verEngineer/InlineProblems/compare/0.1.0...0.1.1 -[0.1.0]: https://github.com/0verEngineer/InlineProblems/commits +[0.3.3]: https://github.com/0verEngineer/InlineProblems/compare/v0.3.2...v0.3.3 +[0.3.2]: https://github.com/0verEngineer/InlineProblems/compare/v0.3.1...v0.3.2 +[0.3.1]: https://github.com/0verEngineer/InlineProblems/compare/v0.2.1...v0.3.1 +[0.2.1]: https://github.com/0verEngineer/InlineProblems/compare/v0.2.0...v0.2.1 +[0.2.0]: https://github.com/0verEngineer/InlineProblems/compare/v0.1.2...v0.2.0 +[0.1.2]: https://github.com/0verEngineer/InlineProblems/compare/v0.1.1...v0.1.2 +[0.1.1]: https://github.com/0verEngineer/InlineProblems/compare/v0.1.0...v0.1.1 +[0.1.0]: https://github.com/0verEngineer/InlineProblems/commits/v0.1.0 diff --git a/README.md b/README.md index f354409..5512a97 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,31 @@ You can turn this plugin on and off with the keyboard shortcut `alt+u`, addition - `printProductsReleases` - lists the IDE builds available for the verifier - Lombok is used, so the Lombok plugin has to be enabled in the development IDE +### Releasing +Branches: features are merged into `main`, `release` holds what is published. Both are protected, +so everything goes through pull requests. + +1. **Changelog** - every change is listed in the `[Unreleased]` section of `CHANGELOG.md`, in the + pull request that makes it +2. **Prepare** - run the "Prepare Release" workflow from the Actions tab with the new version, + e.g. `0.6.2`. It raises `pluginVersion` in `gradle.properties`, moves the `[Unreleased]` section + under `## [0.6.2]` and opens the pull request "Prepare the 0.6.2 release" to `main`. The + workflow stops if `[Unreleased]` is empty. No checks run on this pull request, it is created + with the `GITHUB_TOKEN` +3. **Merge into `main`** - the Build workflow on `main` creates the release draft `v0.6.2` with the + notes of the `[0.6.2]` section. Every push to `main` replaces the draft +4. **Beta** - open the pull request `main -> release`, titled "main -> release for 0.6.2" with the + changelog entry as description. The Beta Release workflow publishes `0.6.2-beta+RC.` to the + Marketplace `beta` channel and creates the GitHub prerelease `v0.6.2-beta` with the changelog. + Every new commit on the pull request publishes a new beta +5. **Merge into `release`** - once the beta is fine. This has to happen before the next step: the + release draft targets `release`, and the tag is created there when the draft is published +6. **Release** - publish the release draft `v0.6.2` on GitHub. The Release workflow publishes the + plugin to the Marketplace `default` and `beta` channels and attaches the ZIP to the release + +The "What's new" on the Marketplace comes from the changelog section of the version, for a beta +too. Changes merged after step 2 belong under the version section, not under `[Unreleased]`. + diff --git a/build.gradle.kts b/build.gradle.kts index 6e82201..4004058 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -67,12 +67,15 @@ intellijPlatform { }.joinToString("\n").let(::markdownToHTML) } - // Get the latest available change notes from the changelog file + /* The changelog section of the version, which the "Prepare release" workflow creates. The + * beta suffix is dropped, so 0.6.1-beta+RC12.1 shows the notes of 0.6.1. Without a section + * the unreleased one is used - not getLatest(), that is the previous release and was the + * reason why 0.6.0 was published with the notes of 0.5.10. */ changeNotes = providers.provider { + val baseVersion = properties("pluginVersion").get().substringBefore('-').substringBefore('+') with(changelog) { renderItem( - getOrNull(properties("pluginVersion").get()) - ?: runCatching { getLatest() }.getOrElse { getUnreleased() }, + (getOrNull(baseVersion) ?: getUnreleased()).withHeader(false).withEmptySections(false), Changelog.OutputType.HTML, ) } @@ -135,12 +138,6 @@ intellijPlatform { } } -// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin -changelog { - groups.set(emptyList()) - repositoryUrl.set(properties("pluginRepositoryUrl")) -} - // Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin qodana { cachePath.set(file(".qodana").canonicalPath) @@ -183,10 +180,6 @@ tasks { targetCompatibility = properties("javaVersion").get() } - publishPlugin { - dependsOn(patchChangelog) - } - runIde { maxHeapSize = "4g" minHeapSize = "2g"