Skip to content

Commit eb9395b

Browse files
authored
feat(vscode): v2 release (#24)
* feat(vscode): prepare v2 release * fix(vscode): activate on load Certain extensions require this setting to work correctly, for example <https://github.com/runtimeverification/ercx-vscode/blob/master/README.md#:~:text=You%20need%20to%20install%20an%20extension%20for%20Solidity%20syntax%20highlighting%20for%20this%20extension%20to%20work%20as%20it%20activates%20onLanguage%3Asolidity> * feat: add gaes.tmLanguage.jsonc (#21) see <https://github.com/fjl/geas> * feat(solidity): add support for custom types (#19) * test(solidity): unit test tmlanguage syntax (#26) * ci(nodejs-ci): upgrade * fix(ci): on pull request * fix(vsce): use @vscode/vsce * fix(solidity): stand back i know regex * feat(vsce): v2.0
1 parent 368a140 commit eb9395b

16 files changed

+4678
-2943
lines changed

.github/workflows/nodejs-ci.yml

Lines changed: 62 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,73 @@
1-
# CI for command line NodeJS Applications
2-
name: nodejs
1+
name: CI
2+
33
on:
44
push:
5-
paths:
6-
- "**/**"
7-
- "!**/*.md/**"
8-
9-
env:
10-
CI: true
11-
FORCE_COLOR: 2
5+
branches:
6+
- master
7+
pull_request:
128

139
jobs:
14-
run:
15-
name: Node ${{ matrix.node }} on ${{ matrix.os }}
16-
runs-on: ${{ matrix.os }}
17-
18-
strategy:
19-
fail-fast: false
20-
matrix:
21-
node: ["14"]
22-
os: ["ubuntu-latest"]
10+
build-test-verify:
11+
runs-on: ubuntu-latest
2312

2413
steps:
25-
- name: Clone repository
26-
uses: actions/[email protected]
14+
- name: Record start time
15+
id: record_time
16+
run: |
17+
echo "BUILD_START=$(date +%s)" >> $GITHUB_ENV
2718
28-
- name: Set up Node.js
29-
uses: actions/[email protected]
19+
- name: Checkout repository
20+
id: checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js
24+
id: setup_node
25+
uses: actions/setup-node@v3
3026
with:
31-
node-version: ${{ matrix.node }}
27+
node-version: 16
3228

33-
- name: Install npm dependencies
29+
- name: Cache node modules
30+
id: cache
31+
uses: actions/cache@v3
32+
with:
33+
path: ~/.npm
34+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
35+
restore-keys: |
36+
${{ runner.os }}-node-
37+
38+
- name: Install dependencies
39+
id: install_deps
3440
run: npm install
3541

36-
- name: Run build
37-
run: npm run ci
42+
- name: Run tests
43+
id: test
44+
run: npm test
45+
46+
- name: Package and Verify VSCode Theme
47+
id: package
48+
run: npx vsce package
49+
50+
- name: Post PR Comment with Build Time and Test Success
51+
if: github.event_name == 'pull_request'
52+
id: post_comment
53+
uses: actions/github-script@v6
54+
with:
55+
script: |
56+
// Get the start time from the environment variable
57+
const buildStart = parseInt(process.env.BUILD_START);
58+
const buildEnd = Math.floor(Date.now() / 1000);
59+
const buildDuration = buildEnd - buildStart;
60+
const commentBody = `✅ Build succeeded in ${buildDuration} seconds. All tests passed.`;
61+
// Extract PR number from the GITHUB_REF (e.g. refs/pull/123/merge)
62+
const prNumberMatch = process.env.GITHUB_REF.match(/refs\/pull\/(\d+)\/merge/);
63+
if (prNumberMatch) {
64+
const prNumber = parseInt(prNumberMatch[1], 10);
65+
await github.rest.issues.createComment({
66+
owner: context.repo.owner,
67+
repo: context.repo.repo,
68+
issue_number: prNumber,
69+
body: commentBody
70+
});
71+
} else {
72+
console.log("Not a pull request event. No comment posted.");
73+
}

.github/workflows/release.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
on: workflow_dispatch
2+
3+
name: Publish VS Code Extension to Microsoft Marketplace and Open VSX
4+
jobs:
5+
deploy:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v4
10+
- name: 'Install nodejs 20'
11+
uses: actions/setup-node@v
12+
with:
13+
node-version: '20'
14+
# Run install dependencies
15+
- name: Install dependencies
16+
run: |
17+
npm install
18+
# Run tests
19+
- name: Build
20+
run: npm run build
21+
- name: Get current package version
22+
id: package_version
23+
uses: martinbeentjes/[email protected]
24+
- name: Check version is mentioned in Changelog
25+
uses: mindsers/[email protected]
26+
with:
27+
version: ${{ steps.package_version.outputs.current-version }}
28+
path: 'CHANGELOG.md'
29+
- name: Create a Release
30+
id: create_release
31+
uses: actions/create-release@v1
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
with:
35+
tag_name : ${{ steps.package_version.outputs.current-version}}
36+
release_name: ${{ steps.package_version.outputs.current-version}}
37+
body: Publish ${{ steps.package_version.outputs.current-version}}
38+
- name: Publish extension to Visual Studio Marketplace
39+
id: create_vsix
40+
uses: HaaLeo/publish-vscode-extension@v2
41+
with:
42+
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
43+
registryUrl: https://marketplace.visualstudio.com
44+
- name: Publish extension to Open VSX
45+
uses: HaaLeo/publish-vscode-extension@v2
46+
with:
47+
pat: ${{ secrets.OPEN_VSX_TOKEN }}
48+
extensionFile: ${{ steps.create_vsix.outputs.vsixPath }}
49+
packagePath: ''
50+
- name: Generate checksums
51+
run: find dist/ -name "*.vsix" -type f -exec sha256sum {} \; > dist/checksums.sha256
52+
53+
- name: Attach vsix to release
54+
uses: actions/upload-release-asset@v1
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
with:
58+
upload_url: ${{ steps.create_release.outputs.upload_url }}
59+
asset_path: ${{ steps.create_vsix.outputs.vsixPath}}
60+
asset_name: ${{ steps.create_vsix.outputs.vsixPath}}
61+
asset_content_type: application/vsix

.vscode/settings.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
22
"files.trimTrailingWhitespace": true,
3-
"gitlens.advanced.blame.customArguments": ["--ignore-revs-file", ".gitignore-revs"]
3+
"gitlens.advanced.blame.customArguments": [
4+
"--ignore-revs-file",
5+
".gitignore-revs"
6+
],
7+
"wake.compiler.solc.remappings": []
48
}

CHANGELOG.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
### Changelog
2+
3+
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
4+
5+
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6+
7+
#### [v1.6.0](https://github.com/contractshark/vscode-solidity-extension/compare/v1.5.0...v1.6.0)
8+
9+
> 2 January 2023
10+
11+
- Release: Yul support [`#12`](https://github.com/contractshark/vscode-solidity-extension/pull/12)
12+
13+
#### [v1.5.0](https://github.com/contractshark/vscode-solidity-extension/compare/v1.4.0...v1.5.0)
14+
15+
> 21 July 2022
16+
17+
- feat: support for unbalancedBracketScopes and balancedBracketScopes [`#10`](https://github.com/contractshark/vscode-solidity-extension/pull/10)
18+
- fix syntax highlighting for `!` and `!=` [`#9`](https://github.com/contractshark/vscode-solidity-extension/pull/9)
19+
20+
#### [v1.4.0](https://github.com/contractshark/vscode-solidity-extension/compare/v1.3.0...v1.4.0)
21+
22+
> 20 March 2022
23+
24+
- feat(natspec): support for @custom and updates to grammar [`#7`](https://github.com/contractshark/vscode-solidity-extension/pull/7)
25+
- v1.3.0 [`#5`](https://github.com/contractshark/vscode-solidity-extension/pull/5)
26+
- docs(readme): open vsx registry [`cb5af4c`](https://github.com/contractshark/vscode-solidity-extension/commit/cb5af4ce902e1169e5d6bc52852ab5a3d34ee10d)
27+
28+
#### [v1.3.0](https://github.com/contractshark/vscode-solidity-extension/compare/v1.2.1...v1.3.0)
29+
30+
> 1 October 2021
31+
32+
- v1.2.0 [`#3`](https://github.com/contractshark/vscode-solidity-extension/pull/3)
33+
- v1.1.0 [`#2`](https://github.com/contractshark/vscode-solidity-extension/pull/2)
34+
- bug/vscode [`#1`](https://github.com/contractshark/vscode-solidity-extension/pull/1)
35+
- feat(vscode): release v1.3.0 [`3f15e3c`](https://github.com/contractshark/vscode-solidity-extension/commit/3f15e3c4b014db649c219756b1669dd8743adc5d)
36+
- Release 1.2.1 [`020ef3b`](https://github.com/contractshark/vscode-solidity-extension/commit/020ef3bb5fdf77966db1ce3e9b12016bb8d7f21c)
37+
- chore(package): pin dependencies, fix git url [`86a55c8`](https://github.com/contractshark/vscode-solidity-extension/commit/86a55c8b74248c25f7d6524ad49bd60b50133d8c)
38+
39+
#### [v1.2.1](https://github.com/contractshark/vscode-solidity-extension/compare/v1.2.0...v1.2.1)
40+
41+
> 17 August 2021
42+
43+
#### [v1.2.0](https://github.com/contractshark/vscode-solidity-extension/compare/v1.1.0...v1.2.0)
44+
45+
> 17 August 2021
46+
47+
- feat(release): EIP1559 support [`4353981`](https://github.com/contractshark/vscode-solidity-extension/commit/43539818462f5b6d5c0b3a6cb3bd0ac992020387)
48+
- Release 1.2.1 [`16f05e8`](https://github.com/contractshark/vscode-solidity-extension/commit/16f05e8020e8bd8581e67853ab6327879cb12eba)
49+
50+
#### [v1.1.0](https://github.com/contractshark/vscode-solidity-extension/compare/v1.0.1...v1.1.0)
51+
52+
> 30 July 2021
53+
54+
- feat(release): v1.1.0 [`efbb953`](https://github.com/contractshark/vscode-solidity-extension/commit/efbb9534d220bbe9efc94a3f296376a88e65bfb5)
55+
- feat(vscode): inital theme overlay [`d11ba45`](https://github.com/contractshark/vscode-solidity-extension/commit/d11ba45b0382e88e3f8c5f38f96242095f1c178b)
56+
- docs(readme): v1.0.0 [`60295d7`](https://github.com/contractshark/vscode-solidity-extension/commit/60295d7b5fc3cdc54f9c5595e5c1e55d01b07e93)
57+
58+
### [v1.0.1](https://github.com/contractshark/vscode-solidity-extension/compare/v0.0.2...v1.0.1)
59+
60+
> 15 April 2021
61+
62+
- test(validate): validate grammar [`d7b281a`](https://github.com/contractshark/vscode-solidity-extension/commit/d7b281a6b1b570cf8afc1b1eae0f1c253de2b6d8)
63+
- fix(ext): url update and CI [`bc29fe5`](https://github.com/contractshark/vscode-solidity-extension/commit/bc29fe53de67ade1058c62285194d691ed488d7f)
64+
- docs(readme): vscode ext [`33d1c37`](https://github.com/contractshark/vscode-solidity-extension/commit/33d1c3731c4f02419a7a9b4cd60d13723e63eaf6)
65+
66+
#### v0.0.2
67+
68+
> 14 April 2021
69+
70+
- release [`06906dc`](https://github.com/contractshark/vscode-solidity-extension/commit/06906dc5dffabb815395d29c9643bf9ff5c86f9e)
71+
- chore(release): 0.0.2 [`c8c2741`](https://github.com/contractshark/vscode-solidity-extension/commit/c8c274182f95fa7d9a9d544857ac4aa58405dc9e)
72+
- build(vsce): package [`aec374a`](https://github.com/contractshark/vscode-solidity-extension/commit/aec374ac38ab110046f018e914fb4b39bb7931e5)

dist/SHA256SUM.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/checksums.sha256

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
f2f534687fd899bee5232cb11e973e6a67a0397258358544d63a4e5f6f0f38a8 dist/solidity-lang-2.0.0.vsix

0 commit comments

Comments
 (0)