From b9f370a904930201b10992bab80ad929b717d27a Mon Sep 17 00:00:00 2001 From: Francesco Stasi Date: Thu, 18 Nov 2021 16:22:45 +0100 Subject: [PATCH 1/3] update Language Server flags --- src/extension.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 7d74003..3ebfb99 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -10,8 +10,8 @@ import { LanguageClient, CloseAction, ErrorAction, InitializeError, Message, Rev interface LanguageServerConfig { readonly lsPath: string; - readonly cliPath: string; - readonly cliConfigPath: string; + readonly cliDaemonAddr: string; + readonly cliDaemonInstance: string; readonly clangdPath: string; readonly board: { readonly fqbn: string; @@ -29,7 +29,7 @@ interface LanguageServerConfig { } interface DebugConfig { - readonly cliPath: string; + readonly cliDaemonAddr: string; readonly board: { readonly fqbn: string; readonly name?: string; @@ -103,7 +103,7 @@ async function startDebug(_: ExtensionContext, config: DebugConfig): Promise { - const { lsPath: command, clangdPath, cliPath, cliConfigPath, board, flags, env, log } = config; - const args = ['-clangd', clangdPath, '-cli', cliPath, '-cli-config', cliConfigPath, '-fqbn', board.fqbn]; + const { lsPath: command, clangdPath, cliDaemonAddr, cliDaemonInstance, board, flags, env, log } = config; + const args = ['-clangd', clangdPath, '-cli-daemon-addr', cliDaemonAddr, '-cli-daemon-instance', cliDaemonInstance, '-fqbn', board.fqbn]; if (board.name) { args.push('-board-name', board.name); } From 45386e9bf02203506a9f70fb03d28203ae8943df Mon Sep 17 00:00:00 2001 From: Francesco Stasi Date: Tue, 23 Nov 2021 15:29:00 +0100 Subject: [PATCH 2/3] updated workflow --- .github/workflows/build.yml | 32 ++++----------------------- .github/workflows/deploy.yml | 42 ++++++++++++++++++++++++++++++++++++ package.json | 2 +- src/extension.ts | 5 +++-- 4 files changed, 50 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a09477f..ef2e4a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,18 +1,11 @@ -name: VS Code Arduino Tools +name: Build on: - push: - branches: - - main - workflow_dispatch: pull_request: branches: - main - schedule: - - cron: '0 2 * * *' # run every day at 2AM jobs: - build: runs-on: ubuntu-latest steps: @@ -22,26 +15,9 @@ jobs: - name: Install Node.js 12.x uses: actions/setup-node@v1 with: - node-version: '12.x' - registry-url: 'https://registry.npmjs.org' + node-version: "12.x" + registry-url: "https://registry.npmjs.org" - name: Build VS Code Extension run: | - yarn - - - name: Upload VS Code Extension [GitHub Actions] - uses: actions/upload-artifact@v2 - with: - name: build-artifacts - path: build-artifacts/ - - - name: Upload VS Code Extension [S3] - if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') - uses: docker://plugins/s3 - env: - PLUGIN_SOURCE: "build-artifacts/*" - PLUGIN_STRIP_PREFIX: "build-artifacts/" - PLUGIN_TARGET: "/vscode-arduino-tools/nightly" - PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + yarn diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..0b788f4 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,42 @@ +name: Deploy + +on: + push: + tags: + - "*" + workflow_dispatch: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: "12.x" + registry-url: "https://registry.npmjs.org" + + - name: Build VS Code Extension + run: | + yarn + + - name: Upload VS Code Extension [GitHub Actions] + uses: actions/upload-artifact@v2 + with: + name: build-artifacts + path: build-artifacts/ + + - name: Upload VS Code Extension [S3] + uses: docker://plugins/s3 + env: + PLUGIN_SOURCE: "build-artifacts/*" + PLUGIN_STRIP_PREFIX: "build-artifacts/" + PLUGIN_TARGET: "/vscode-arduino-tools/nightly" + PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/package.json b/package.json index 7e2e987..6a76d38 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vscode-arduino-tools", "private": true, - "version": "0.0.1-beta.1", + "version": "0.0.2-beta.1", "publisher": "arduino", "license": "Apache-2.0", "author": "Arduino SA", diff --git a/src/extension.ts b/src/extension.ts index 3ebfb99..d07fb03 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -29,7 +29,8 @@ interface LanguageServerConfig { } interface DebugConfig { - readonly cliDaemonAddr: string; + readonly cliPath?: string; + readonly cliDaemonAddr?: string; readonly board: { readonly fqbn: string; readonly name?: string; @@ -103,7 +104,7 @@ async function startDebug(_: ExtensionContext, config: DebugConfig): Promise Date: Tue, 23 Nov 2021 15:32:45 +0100 Subject: [PATCH 3/3] updated readme --- .github/workflows/deploy.yml | 2 +- README.md | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0b788f4..b085648 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -36,7 +36,7 @@ jobs: env: PLUGIN_SOURCE: "build-artifacts/*" PLUGIN_STRIP_PREFIX: "build-artifacts/" - PLUGIN_TARGET: "/vscode-arduino-tools/nightly" + PLUGIN_TARGET: "/vscode-arduino-tools" PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/README.md b/README.md index 876dd31..16ce361 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,9 @@ In order to ease code reviews and have your contributions merged faster, here is - Your PR must pass all CI tests before we will merge it. If you're seeing an error and don't think it's your fault, it may not be! The reviewer will help you if there are test failures that seem not related to the change you are making. ## Build + To build the Arduino Tools VS Code extension (VSIX), execute: + ``` yarn ``` @@ -54,6 +56,13 @@ Or from the [_Command Palette_](https://code.visualstudio.com/docs/editor/extens You can also start the extension in debug mode. Open the `Debug` panel, and select the `Launch Arduino Tools – VS Code Extension` launch configuration. +## Deployments + +To deploy a new release of the tools you have to do the following: + +- update the `version` in the package.json file +- push a tag to the repo with `v` and the version you spacified in the package.json, for example `v0.0.2-beta.1` + ## Donations This open source code was written by the Arduino team and is maintained on a daily basis with the help of the community. We invest a considerable amount of time in development, testing and optimization. Please consider [donating](https://www.arduino.cc/en/donate/) or [sponsoring](https://github.com/sponsors/arduino) to support our work, as well as [buying original Arduino boards](https://store.arduino.cc/) which is the best way to make sure our effort can continue in the long term. @@ -61,4 +70,3 @@ This open source code was written by the Arduino team and is maintained on a dai ## License The code contained in this repository is licensed under the terms of the Apache 2.0 license. If you have questions about licensing please contact us at [license@arduino.cc](mailto:license@arduino.cc). -