From db87423071fbeadde7440084445fd1bc21534d7b Mon Sep 17 00:00:00 2001 From: Dmitry Maslennikov Date: Tue, 14 Jan 2020 11:26:06 +0300 Subject: [PATCH] update version build number --- .github/workflows/main.yml | 37 ++++++++++++++++++++++++------------- package.json | 2 +- src/extension.ts | 10 +++++++--- 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ee105d0b..4f19378e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,6 +16,20 @@ jobs: set -e /usr/bin/Xvfb :10 -ac >> /tmp/Xvfb.out 2>&1 & disown -ar + - name: Set an output + id: set-version + if: runner.os == 'Linux' + run: | + set -x + VERSION=$(jq -r '.version' package.json | cut -d- -f1) + echo ::set-output name=changelog::$(cat CHANGELOG.md | sed -n "/## \[${VERSION}\]/,/## /p" | sed '/^$/d;1d;$d') + VERSION+=-beta + git tag -l | cat + VERSION+=$(($(git tag -l "v$VERSION*" 2>/dev/null | tail -1 | cut -d. -f4)+1)) + echo ::set-output name=version::$VERSION + echo ::set-output name=name::$(jq -r '.name' package.json)-$VERSION + tmp=$(mktemp) + jq --arg version "$VERSION" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json - name: Use Node.js uses: actions/setup-node@master with: @@ -25,17 +39,11 @@ jobs: - run: npm run test env: DISPLAY: :10 - - name: Set an output - id: get-version - if: runner.os == 'Linux' - run: | - echo ::set-output name=version::$(jq -r '.version' package.json | cut -d- -f1)-B$(date -u "+%Y%m%d") - echo ::set-output name=name::$(jq -r '.name+"-"+.version' package.json | cut -d- -f1-3)-B$(date -u "+%Y%m%d") - name: Build package if: runner.os == 'Linux' run: | mkdir dist - ./node_modules/.bin/vsce package -o ./dist/${{ steps.get-version.outputs.name }}.vsix + ./node_modules/.bin/vsce package -o ./dist/${{ steps.set-version.outputs.name }}.vsix - name: Create Release id: create_release uses: actions/create-release@v1 @@ -43,18 +51,21 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: v${{ steps.get-version.outputs.version }} - release_name: v${{ steps.get-version.outputs.version }} + tag_name: v${{ steps.set-version.outputs.version }} + release_name: v${{ steps.set-version.outputs.version }} + body: | + Changes in this release + ${{ steps.set-version.outputs.changelog}} draft: false prerelease: true - name: Upload Release Asset - id: upload-release-asset + id: upload-release-asset uses: actions/upload-release-asset@v1.0.1 if: runner.os == 'Linux' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./dist/${{ steps.get-version.outputs.name }}.vsix - asset_name: ${{ steps.get-version.outputs.name }}.vsix - asset_content_type: application/zip \ No newline at end of file + asset_path: ./dist/${{ steps.set-version.outputs.name }}.vsix + asset_name: ${{ steps.set-version.outputs.name }}.vsix + asset_content_type: application/zip diff --git a/package.json b/package.json index a9b635c4..d34eed4e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "InterSystems ObjectScript language support for Visual Studio Code", "version": "0.7.14-SNAPSHOT", "icon": "images/logo.png", - "aiKey": "62520d06-0454-4694-ad43-0ff4bd613c04", + "aiKey": "7047c4a1-fc13-43ea-a485-01a74ff0b2af", "categories": [ "Programming Languages", "Other", diff --git a/src/extension.ts b/src/extension.ts index 037c67ab..c3b52463 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -97,7 +97,7 @@ export function getXmlUri(uri: vscode.Uri): vscode.Uri { scheme: OBJECTSCRIPTXML_FILE_SCHEMA, }); } -let reporter; +let reporter: TelemetryReporter; export const checkConnection = (clearCookies = false): void => { const conn = config("conn"); @@ -125,8 +125,12 @@ export const checkConnection = (clearCookies = false): void => { } api .serverInfo() - .then(async info => { - // panel.text = `${connInfo} - Connected`; + .then(info => { + const hasHS = info.result.content.features.find(el => el.name === "HEALTHSHARE" && el.enabled) !== undefined; + reporter.sendTelemetryEvent("connected", { + serverVersion: info.result.content.version, + healthshare: hasHS ? "yes" : "no", + }); }) .catch(error => { let message = error.message;