diff --git a/src/.releaserc.json b/src/.releaserc.json index baed182..0ca2099 100644 --- a/src/.releaserc.json +++ b/src/.releaserc.json @@ -111,6 +111,17 @@ "numReplacements": 1 }], "countMatches": true + },{ + "files": ["LAST_RELEASE_NOTES.md"], + "from": ".*", + "to": "${nextRelease.notes}", + "results": [{ + "file": "LAST_RELEASE_NOTES.md", + "hasChanged": true, + "numMatches": 1, + "numReplacements": 1 + }], + "countMatches": true }] }], ["@semantic-release/npm",{ @@ -128,7 +139,8 @@ "intellij/contextive/src/main/resources/META-INF/plugin.xml", "visualstudio/contextive/contextive/contextive.csproj", "visualstudio/contextive/contextive/README.md", - "visualstudio/contextive/contextive/ContextiveExtension.cs" + "visualstudio/contextive/contextive/ContextiveExtension.cs", + "LAST_RELEASE_NOTES.md" ] }], "@semantic-release/github" diff --git a/src/LAST_RELEASE_NOTES.md b/src/LAST_RELEASE_NOTES.md new file mode 100644 index 0000000..29ee527 --- /dev/null +++ b/src/LAST_RELEASE_NOTES.md @@ -0,0 +1,16 @@ +# [1.12.0](https://github.com/dev-cycles/contextive/compare/v1.11.1...v1.12.0) (2024-09-04) + + +### Bug Fixes + +* **intellij:** Add support for 2042.2 series of intellij platform ([08308bf](https://github.com/dev-cycles/contextive/commit/08308bff2056fd1af764d88649de7fe90b8516b1)) + + +### Features + +* **language-server:** Add support for LSP Clients that only support rootUri and not workspaces (e.g. Visual Studio) ([7fe11b3](https://github.com/dev-cycles/contextive/commit/7fe11b3831d6f8b8f86d1d10817c7ba50a0163c0)) +* **language-server:** Add yaml schema for definitions file ([#74](https://github.com/dev-cycles/contextive/issues/74)) ([65ec44a](https://github.com/dev-cycles/contextive/commit/65ec44a16de20357b69d1662cfc70521298287da)) +* **language-server:** Only use 'window/showMessage' if it is supported by the LanguageClient (e.g. Visual Studio does not support it) ([965cb30](https://github.com/dev-cycles/contextive/commit/965cb30539ea05357dfd6cdf4e2bb44406d8a16c)) +* **language-server:** validate definitions file for missing term names ([0fb0978](https://github.com/dev-cycles/contextive/commit/0fb0978640f594843d1f8ff25959ea3d0bf729ae)) +* **visual-studio:** Add Visual Studio integration ([b052a82](https://github.com/dev-cycles/contextive/commit/b052a82df7df39d518760f8dfcae84771505262f)), closes [#28](https://github.com/dev-cycles/contextive/issues/28) +* **vscode:** Publish to Open-Vsx Marketplace (closes [#80](https://github.com/dev-cycles/contextive/issues/80)) ([2d23775](https://github.com/dev-cycles/contextive/commit/2d23775c6c99468319fdf68d7bad2b1997fad883)) \ No newline at end of file diff --git a/src/ci/common.fsx b/src/ci/common.fsx index 7806ea5..f341a65 100644 --- a/src/ci/common.fsx +++ b/src/ci/common.fsx @@ -1,4 +1,4 @@ -#r "nuget: Fun.Build, 1.0.5" +#r "nuget: Fun.Build, 1.1.7" open Fun.Build @@ -44,9 +44,6 @@ let ifTopLevelStage fn (ctx: Internal.StageContext) = | ValueSome(Internal.StageParent.Pipeline _) -> fn ctx | _ -> () -let echoGitHubGroupStart (ctx: Internal.StageContext) = printfn "::group::%s" ctx.Name -let echoGitHubGroupEnd (_: Internal.StageContext) = printfn "::endgroup::" - let ghError msg = printfn $"::error ::{msg}" Error(msg) @@ -70,10 +67,6 @@ let unzipCmd zipPath outputPath = | "" -> $"unzip {zipPath} -d {outputPath}" | _ -> $"7z e {zipPath} -o{outputPath}" -let gitHubGroupStart = ifTopLevelStage <| echoGitHubGroupStart - -let gitHubGroupEnd = ifTopLevelStage <| echoGitHubGroupEnd - let dotnetRestoreTools = stage $"Dotnet Restore Tools" { run "dotnet tool restore" } @@ -103,3 +96,12 @@ let core = let languageServer = { Name = "Contextive.LanguageServer" Path = "language-server/Contextive.LanguageServer" } + +let whenComponentInRelease (component': string) = whenStage $"Check for component {component'} in LAST_CHANGE.md" { + run (fun ctx -> + seq { component'; "language-server" } + |> String.concat "|" + |> sprintf "grep -E (%s) LAST_RELEASE_NOTES.md" + |> ctx.RunCommand + ) +} diff --git a/src/intellij/build.fsx b/src/intellij/build.fsx index d9e1de9..b6d132a 100644 --- a/src/intellij/build.fsx +++ b/src/intellij/build.fsx @@ -2,7 +2,7 @@ #load "../ci/common.fsx" open Fun.Build - +open Fun.Build.Github open Common let distPath: string = "intellij/contextive/build/distributions" @@ -16,8 +16,7 @@ let intelliJAssetLabel (ctx: Internal.StageContext) = pipeline "Contextive IntelliJ Plugin" { description "Build & Test" noPrefixForStep - runBeforeEachStage gitHubGroupStart - runAfterEachStage gitHubGroupEnd + collapseGithubActionLogs logEnvironment @@ -33,7 +32,10 @@ pipeline "Contextive IntelliJ Plugin" { run (fun ctx -> $"gh release upload {ctx.GetCmdArg(args.release)} {intelliJAssetFileName ctx}") } - stage "Publish Package" { run (bashCmd "./gradlew publishPlugin") } + stage "Publish Package" { + whenComponentInRelease "intellij" + run (bashCmd "./gradlew publishPlugin") + } } runIfOnlySpecified false diff --git a/src/language-server/build.fsx b/src/language-server/build.fsx index f5ef709..a70499d 100644 --- a/src/language-server/build.fsx +++ b/src/language-server/build.fsx @@ -2,7 +2,7 @@ #load "../ci/common.fsx" open Fun.Build - +open Fun.Build.Github open Common let languageServerLabel (ctx: Internal.StageContext) = @@ -100,8 +100,7 @@ let zipAndUploadAsset app = pipeline languageServer.Name { description "Build & Test" // noPrefixForStep - runBeforeEachStage gitHubGroupStart - runAfterEachStage gitHubGroupEnd + collapseGithubActionLogs logEnvironment diff --git a/src/release.fsx b/src/release.fsx index cc9e3ce..98886d0 100644 --- a/src/release.fsx +++ b/src/release.fsx @@ -4,6 +4,7 @@ #load "ci/common.fsx" open Fun.Build +open Fun.Build.Github open FSharp.Data open FsToolkit.ErrorHandling open FsToolkit.ErrorHandling.Operator.AsyncResult @@ -72,8 +73,7 @@ let checkReleaseStatus (ctx: Internal.StageContext) = pipeline "Contextive Release" { noPrefixForStep - runBeforeEachStage gitHubGroupStart - runAfterEachStage gitHubGroupEnd + collapseGithubActionLogs stage "Check Build Status" { whenEnv { name args.headSha.Name } diff --git a/src/visualstudio/build.fsx b/src/visualstudio/build.fsx index 63d3337..09535cf 100644 --- a/src/visualstudio/build.fsx +++ b/src/visualstudio/build.fsx @@ -2,7 +2,7 @@ #load "../ci/common.fsx" open Fun.Build - +open Fun.Build.Github open Common let visualStudioProjectPath = "visualstudio/contextive/contextive" @@ -19,8 +19,7 @@ let vsixPublisherExe = """C:\Program Files\Microsoft Visual Studio\2022\Enterpri pipeline "Contextive Visual Studio Extension" { description "Build & Test" noPrefixForStep - runBeforeEachStage gitHubGroupStart - runAfterEachStage gitHubGroupEnd + collapseGithubActionLogs logEnvironment @@ -64,8 +63,10 @@ pipeline "Contextive Visual Studio Extension" { } // See https://learn.microsoft.com/en-us/visualstudio/extensibility/walkthrough-publishing-a-visual-studio-extension-via-command-line?view=vs-2022 - stage "Publish to Marketplace" { run (fun ctx -> - $"\"{vsixPublisherExe}\" publish -payload \"{visualStudioAssetRelativePath}/{visualStudioAssetFileName}\" -publishManifest \"publishmanifest.json\" -personalAccessToken \"{ctx.GetEnvVar(args.vscePat.Name)}\"" + stage "Publish to Marketplace" { + whenComponentInRelease "visual-studio" + run (fun ctx -> + $"\"{vsixPublisherExe}\" publish -payload \"{visualStudioAssetRelativePath}/{visualStudioAssetFileName}\" -publishManifest \"publishmanifest.json\" -personalAccessToken \"{ctx.GetEnvVar(args.vscePat.Name)}\"" ) } } diff --git a/src/vscode/build.fsx b/src/vscode/build.fsx index d6a867a..9dd4bd2 100644 --- a/src/vscode/build.fsx +++ b/src/vscode/build.fsx @@ -1,8 +1,7 @@ -#r "nuget: Fun.Build, 1.0.5" #load "../ci/common.fsx" open Fun.Build - +open Fun.Build.Github open Common let vsCodeAssetFileName (ctx: Internal.StageContext) = @@ -21,9 +20,8 @@ let publishTag (ctx: Internal.StageContext) = pipeline "Contextive VsCode Extension" { description "Build & Test" noPrefixForStep - runBeforeEachStage gitHubGroupStart - runAfterEachStage gitHubGroupEnd - + collapseGithubActionLogs + logEnvironment stage "Install Tools" { @@ -133,8 +131,12 @@ pipeline "Contextive VsCode Extension" { run (fun ctx -> $"gh release upload {ctx.GetCmdArg(args.release)} {vsCodeAssetFileName ctx}") } - stage "Publish to Microsoft VS Marketplace" { run (fun ctx -> $"npx vsce publish --packagePath {vsCodeAssetFileName ctx}") } - stage "Publish to Open-Vsx Marketplace" { run (fun ctx -> $"npx ovsx publish {vsCodeAssetFileName ctx} -p \"{ctx.GetEnvVar(args.ovsxPat.Name)}\"") } + stage "Publish to Marketplaces" { + whenComponentInRelease "vscode" + + stage "To Microsoft VS Marketplace" { run (fun ctx -> $"npx vsce publish --packagePath {vsCodeAssetFileName ctx}") } + stage "To Open-Vsx Marketplace" { run (fun ctx -> $"npx ovsx publish {vsCodeAssetFileName ctx} -p \"{ctx.GetEnvVar(args.ovsxPat.Name)}\"") } + } } runIfOnlySpecified false