Skip to content

Commit cb414b0

Browse files
authored
feat(release): automate release (#4)
Signed-off-by: dankeboy36 <[email protected]>
1 parent d792871 commit cb414b0

File tree

9 files changed

+16818
-5430
lines changed

9 files changed

+16818
-5430
lines changed

.github/workflows/build.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
name: test (${{ matrix.os }}, node-${{ matrix.node }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [windows-latest, ubuntu-latest, macos-latest]
18+
node: [18.x]
19+
runs-on: ${{ matrix.os }}
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
with:
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
- name: Use Node.js
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: ${{ matrix.config.node }}
29+
- name: Install Dependencies
30+
run: npm ci
31+
- name: Check Format
32+
run: npm run format && git diff --exit-code
33+
- name: Test
34+
uses: coactions/setup-xvfb@v1
35+
with:
36+
run: npm test
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
40+
release:
41+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
42+
runs-on: ubuntu-latest
43+
needs: [build]
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@v3
47+
with:
48+
persist-credentials: false
49+
- name: Use Node.js
50+
uses: actions/setup-node@v1
51+
with:
52+
node-version: 18.x
53+
- name: Install Dependencies
54+
run: npm ci
55+
- name: Build
56+
run: npm run build
57+
- name: Release
58+
id: release
59+
run: npm run release
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.ADMIN_TOKEN }}
62+
VSCE_PAT: ${{ secrets.VSCE_PAT }}
63+
OVSX_PAT: ${{ secrets.OVSX_PAT }}
64+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
65+
outputs:
66+
release_version: ${{ steps.release.outputs.release_version }}

.github/workflows/ci.yml

-27
This file was deleted.

.github/workflows/pr-title.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: PR Title
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- reopened
8+
- edited
9+
- synchronize
10+
11+
jobs:
12+
validate:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: amannn/[email protected]
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

+8-18
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# vscode-arduino-api
22

3-
[![Tests](https://github.com/dankeboy36/vscode-arduino-api/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/dankeboy36/vscode-arduino-api/actions/workflows/ci.yml)
3+
[![Build](https://github.com/dankeboy36/vscode-arduino-api/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/dankeboy36/vscode-arduino-api/actions/workflows/build.yml)
44

5-
[Arduino IDE](<(https://github.com/arduino/arduino-ide)>) API for VS Code extensions.
5+
[Arduino IDE](https://github.com/arduino/arduino-ide) API for VS Code extensions.
66

7-
This VS Code extension does not provide any functionality but a bridge between the Arduino IDE and external tools implemented as a VS Code extension. Please reference [arduino/arduino-ide#58](https://github.com/arduino/arduino-ide/issues/58) to explain why this VSIX has been created.
7+
This VS Code extension does not provide any functionality but a bridge between the Arduino IDE and external tools implemented as a VS Code extension. Please reference [arduino/arduino-ide#58](https://github.com/arduino/arduino-ide/issues/58) to see why this VSIX has been created.
88

9-
> ⚠️ This extension has nothing to do with the [Visual Studio Code extension for Arduino](https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.vscode-arduino). This extension does not work in VS Code.
9+
> ⚠️ This extension has nothing to do with the [Visual Studio Code extension for Arduino](https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.vscode-arduino).
1010
1111
## API
1212

13-
Exposes the Arduino context for VS Code extensions:
13+
Exposes the Arduino state for VS Code extensions:
1414

15-
| Name | Description | Type | Note |
16-
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------- | ----------- |
15+
| Name | Description | Type | Note |
16+
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------- | :---------: |
1717
| `sketchPath` | Absolute filesystem path of the sketch folder. | `string` |
1818
| `compileSummary` | The summary of the latest sketch compilation. When the `sketchPath` is available, but the sketch has not been verified (compiled), the `buildPath` can be `undefined`. | `CompileSummary` | ⚠️ `@alpha` |
1919
| `fqbn` | The Fully Qualified Board Name (FQBN) of the currently selected board in the Arduino IDE. | `string` |
@@ -82,7 +82,7 @@ This extension contributes the following settings:
8282
8383
---
8484
85-
- Q: What does `@alpha` mean?
85+
- Q: What does ⚠️ `@alpha` mean?
8686
- A: This API is in an alpha state and might change. The initial idea of this project was to establish a bare minimum layer and help Arduino IDE tool developers start with something. I make breaking changes only when necessary, keep it backward compatible, or provide a migration guide in the future. Please prepare for breaking changes.
8787
8888
---
@@ -92,15 +92,5 @@ This extension contributes the following settings:
9292
9393
---
9494
95-
- Q: I cannot find the `dankeboy36.vscode-arduino-api` extension in neither the [VS Code Marketplace](https://marketplace.visualstudio.com/vscode) nor [Open VSX Registry](https://open-vsx.org/).
96-
- A: Correct. This solution targets the [Arduino IDE](https://github.com/arduino/arduino-ide) 2.x. The IDE will contain this VSIX at runtime and will activate it before your tool VSIX. You do not even have to add `dankeboy36.vscode-arduino-api` to the `extensionDependencies`. I might publish the VSIX later when it works in VS Code. By the way, the VSIX is signed by a verified publisher. You can get the latest version from the GitHub [release page](https://github.com/dankeboy36/vscode-arduino-api/releases/latest).
97-
98-
---
99-
10095
- Q: Are there any dependent examples?
10196
- A: Yes, for example, [dankeboy36/esp-exception-decoder](https://github.com/dankeboy36/esp-exception-decoder).
102-
103-
---
104-
105-
- Q: Are there plans to support it in VS Code?
106-
- A: Sure.

0 commit comments

Comments
 (0)