diff --git a/.github/workflows/publish-release-version.yml b/.github/workflows/publish-release-version.yml index 6134bdc..6249d09 100644 --- a/.github/workflows/publish-release-version.yml +++ b/.github/workflows/publish-release-version.yml @@ -22,6 +22,9 @@ jobs: workflow: build-and-test.yml name: vscode-extension-artifacts + - name: Extract version changelog + run: ./extract_version_changelog.sh ${{ github.ref_name }} >> version_changelog.txt + - name: Release uses: softprops/action-gh-release@v1 with: @@ -29,3 +32,4 @@ jobs: CHANGELOG.md LICENSE *.vsix + body_path: version_changelog.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index a3d0ea7..c685f91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,17 @@ All notable changes to the "hylo-vscode" extension will be documented in this file. -## v0.7.2 - 2023-10-27 + +## v0.7.3 + +- Update LSP Server command will now overwrite local dev version + +## v0.7.2 - Use extension path as working directory - Allow log file to be written -## v0.7.1 - 2023-10-27 +## v0.7.1 First documented release diff --git a/extract_version_changelog.sh b/extract_version_changelog.sh new file mode 100755 index 0000000..e58f0cc --- /dev/null +++ b/extract_version_changelog.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +start_heading="## $1" + +end_heading="#" + +# The file to process +file="CHANGELOG.md" + +awk -v start="$start_heading" -v end="$end_heading" ' + $0 ~ start {flag=1; next} + $0 ~ end {flag=0} + flag {print} +' "$file" diff --git a/package-lock.json b/package-lock.json index 24bbd31..8cdc4e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "hylo-lang", - "version": "0.7.1", + "version": "0.7.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "hylo-lang", - "version": "0.7.1", + "version": "0.7.3", "license": "MIT", "dependencies": { "decompress": "^4.2.1", diff --git a/package.json b/package.json index c82e917..9f251b5 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "Hylo", "description": "Hylo Language Support for VSCode", "license": "MIT", - "version": "0.7.2", + "version": "0.7.3", "repository": { "type": "git", "url": "https://github.com/koliyo/hylo-vscode-extension" diff --git a/src/download-hylo-lsp.ts b/src/download-hylo-lsp.ts index 5458f87..85384ef 100644 --- a/src/download-hylo-lsp.ts +++ b/src/download-hylo-lsp.ts @@ -100,7 +100,7 @@ export function getInstalledVersion(): VersionData | null { } } -export async function updateLspServer(): Promise { +export async function updateLspServer(overwriteDev: boolean): Promise { try { const releaseUrl = 'https://api.github.com/repos/koliyo/hylo-lsp/releases/latest' const distDirectory = 'dist' @@ -109,7 +109,7 @@ export async function updateLspServer(): Promise { const stdlibAssetFilename = 'hylo-stdlib.zip' const manifestPath = `${distDirectory}/manifest.json` - wrappedOutput.appendLine(`Check for new release: ${releaseUrl}`) + wrappedOutput.appendLine(`Check for new release: ${releaseUrl}, overwriteDev: ${overwriteDev}`) const response = await fetch(releaseUrl) const body = await response.text() @@ -119,7 +119,7 @@ export async function updateLspServer(): Promise { const localVersion = getInstalledVersion() const target = getTargetLspFilename() - if (localVersion?.isDev) { + if (!overwriteDev && localVersion?.isDev) { wrappedOutput.appendLine(`Dev version detected: ${localVersion}`) return true } diff --git a/src/extension.ts b/src/extension.ts index 6bcab06..159343a 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -82,7 +82,7 @@ async function activateBackend(context: ExtensionContext) { else { // Check if update is available // NOTE: We continue launch process even if update fails, because we can still have working local install - await updateLspServer() + await updateLspServer(false) // hyloRoot = hyloLpsConfig.get('rootDirectory')! // if (!hyloRoot) { @@ -162,7 +162,7 @@ export async function activate(context: ExtensionContext) { function registerCommands() { commands.registerCommand('hylo.updateLspServer', async () => { - await updateLspServer() + await updateLspServer(true) }) commands.registerCommand('hylo.restartLspServer', async () => {