Skip to content

Commit 8c57af1

Browse files
authored
Feat/tips options (#8)
* workflow debug * 0.0.8 * 0.0.9 * 0.0.10 * tips options demo * feat:support tips of options * add github workflow * add github workflow2 * 0.0.19 * feat: optimize tips order to compatible with terraform extension * 0.0.20 * feat: update json
1 parent 5e5fe90 commit 8c57af1

File tree

14 files changed

+10866
-7966
lines changed

14 files changed

+10866
-7966
lines changed

.github/.DS_Store

8 KB
Binary file not shown.

.github/workflows/pr-check.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: pr-check
2+
on:
3+
pull_request:
4+
paths:
5+
- "**.yml"
6+
- "src/**"
7+
- "config/**"
8+
- "resource/**"
9+
- "package.json"
10+
11+
jobs:
12+
pr-check:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
- name: Install Node.js
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: 16.x
21+
- run: npm install
22+
- name: Run headless test
23+
uses: coactions/setup-xvfb@v1
24+
if: runner.os == 'Linux'
25+
with:
26+
run: xvfb-run -a npm test
27+
- name: Run test
28+
run: npm test
29+
if: runner.os != 'Linux'

.github/workflows/pre-release-tag.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: pre-release-tag
2+
on:
3+
pull_request:
4+
paths:
5+
- "**.yml"
6+
- "src/**"
7+
- "config/**"
8+
- "resource/**"
9+
- "package.json"
10+
types:
11+
- labeled
12+
13+
jobs:
14+
pre-release-tag:
15+
if: ${{ github.event.label.name == 'pre-release' }}
16+
permissions:
17+
contents: write
18+
runs-on: ubuntu-latest
19+
environment: RELEASE_ENV
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
- name: Install Node.js
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: 16.x
27+
- run: npm ci
28+
29+
- name: Set Git identity
30+
run: |
31+
git config user.email "[email protected]"
32+
git config user.name "nickyinluo"
33+
34+
- name: Get Current Version
35+
id: vscode-ext-pkg-ver
36+
uses: martinbeentjes/[email protected]
37+
38+
- name: "Automated Version Bump"
39+
id: version-bump
40+
uses: "phips28/gh-action-bump-version@master"
41+
with:
42+
tag-prefix: "v"
43+
version-type: "patch"
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
47+
- name: "Output NEW_TAG"
48+
env:
49+
NEW_TAG: ${{ steps.version-bump.outputs.newTag }}
50+
OLD_VER: ${{ steps.vscode-ext-pkg-ver.outputs.current-version }}
51+
run: echo "new tag[$NEW_TAG], old version[$OLD_VER]"

.github/workflows/pre-release.yml

Lines changed: 50 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,66 @@
11
name: pre-release
22
on:
3+
pull_request:
4+
types:
5+
- closed
36
push:
4-
branches:
5-
- master
67
tags:
7-
- v*
8-
- v*.*.*
8+
- "v*"
99

1010
jobs:
11-
build:
11+
pre-release:
12+
if: github.event.pull_request.merged == true || startsWith(github.ref, 'refs/tags/')
13+
permissions:
14+
contents: write
15+
pull-requests: write
1216
runs-on: ubuntu-latest
17+
environment: RELEASE_ENV
1318
steps:
1419
- name: Checkout
1520
uses: actions/checkout@v3
1621
- name: Install Node.js
1722
uses: actions/setup-node@v3
1823
with:
1924
node-version: 16.x
20-
- run: npm install
21-
- name: Run headless test
22-
uses: coactions/setup-xvfb@v1
23-
if: runner.os == 'Linux'
24-
with:
25-
run: xvfb-run -a npm test
26-
- run: npm test
27-
if: runner.os != 'Linux'
28-
- name: Pre release
29-
if: success() && startsWith(github.ref, 'refs/tags/')
30-
run: vsce package --no-yarn
25+
- run: npm ci
26+
27+
- name: Set tags from commit tag
28+
if: startsWith(github.ref, 'refs/tags/')
29+
run: |
30+
NEW_TAG=${GITHUB_REF#refs/tags/}
31+
echo "NEW_TAG=$NEW_TAG" >> $GITHUB_ENV
32+
echo "new tag[${{ env.NEW_TAG }}] from commit tag will be set"
33+
34+
- name: Get Current Version
35+
id: vscode-ext-pkg-ver
36+
uses: martinbeentjes/[email protected]
37+
38+
- name: Set tags from label
39+
if: startsWith(github.ref, 'refs/heads/')
40+
run: |
41+
echo "NEW_TAG=${{ steps.vscode-ext-pkg-ver.outputs.current-version}}" >> $GITHUB_ENV
42+
echo "new tag [${{ env.NEW_TAG }}] from label will be set"
43+
44+
- run: echo "NEW_TAG:[${{ env.NEW_TAG }}]"
45+
46+
- name: Set Git identity
47+
run: |
48+
git config user.email "[email protected]"
49+
git config user.name "nickyinluo"
50+
51+
- name: Package extension
52+
if: success()
53+
run: |
54+
npm run package.current
3155
env:
3256
VSCE_PAT: ${{ secrets.VS_MARKETPLACE_TOKEN }}
57+
58+
- name: Pre-release to Github
59+
uses: "marvinpinto/action-automatic-releases@latest"
60+
with:
61+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
62+
automatic_release_tag: ${{ env.NEW_TAG }}
63+
prerelease: true
64+
title: "v${{ env.NEW_TAG }}-beta"
65+
files: |
66+
vscode-tencentcloud-terraform-*.vsix

.github/workflows/release.yml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,48 @@
11
name: release
22
on:
3-
push:
4-
branches:
5-
- master
63
release:
74
types:
8-
- created
5+
- released
96

107
jobs:
118
release:
9+
permissions:
10+
contents: write
11+
pull-requests: write
1212
runs-on: ubuntu-latest
13+
environment: TOKEN_VSCODE
1314
steps:
1415
- name: Checkout
1516
uses: actions/checkout@v3
1617
- name: Install Node.js
1718
uses: actions/setup-node@v3
1819
with:
1920
node-version: 16.x
20-
- name: Publish to vs marketplace
21-
if: success() && startsWith(github.ref, 'refs/tags/')
22-
run: npm run release
21+
- run: npm ci
22+
23+
- name: Set Git identity
24+
run: |
25+
git config user.email "[email protected]"
26+
git config user.name "nickyinluo"
27+
28+
- name: Publish to VS Marketplace
29+
if: success()
30+
run: |
31+
npm run package.current
32+
npm run release.current
2333
env:
2434
VSCE_PAT: ${{ secrets.VS_MARKETPLACE_TOKEN }}
35+
36+
- name: Get Current Version
37+
id: vscode-ext-pkg-ver
38+
uses: martinbeentjes/[email protected]
39+
40+
- name: Releaes to Github
41+
uses: "marvinpinto/action-automatic-releases@latest"
42+
with:
43+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
44+
automatic_release_tag: ${{ steps.vscode-ext-pkg-ver.outputs.current-version}}
45+
prerelease: false
46+
title: "v${{ steps.vscode-ext-pkg-ver.outputs.current-version}}"
47+
files: |
48+
vscode-tencentcloud-terraform-*.vsix

.vscode/launch.json

Lines changed: 46 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,51 @@
33
// Hover to view descriptions of existing attributes.
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
{
6-
"version": "0.2.0",
7-
"configurations": [
8-
{
9-
"name": "Run Extension",
10-
"type": "extensionHost",
11-
"request": "launch",
12-
"args": [
13-
"--extensionDevelopmentPath=${workspaceFolder}"
14-
],
15-
"outFiles": [
16-
"${workspaceFolder}/out/**/*.js"
17-
],
18-
"preLaunchTask": "${defaultBuildTask}",
19-
"env": {
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Run Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"args": [
13+
"--extensionDevelopmentPath=${workspaceFolder}"
14+
],
15+
"outFiles": [
16+
"${workspaceFolder}/out/**/*.js"
17+
],
18+
"preLaunchTask": "${defaultBuildTask}",
19+
"env": {
2020
"DEBUG": "true" // <---- EXAMPLE ENVIRONMENT VARIABLE
2121
}
22-
},
23-
{
24-
"name": "Extension Tests",
25-
"type": "extensionHost",
26-
"request": "launch",
27-
"args": [
28-
"--extensionDevelopmentPath=${workspaceFolder}",
29-
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
30-
],
31-
"outFiles": [
32-
"${workspaceFolder}/out/test/**/*.js"
33-
],
34-
"preLaunchTask": "${defaultBuildTask}"
35-
}
36-
]
37-
}
22+
},
23+
{
24+
"name": "Debug Extension",
25+
"type": "extensionHost",
26+
"request": "launch",
27+
"args": [
28+
"--extensionDevelopmentPath=${workspaceFolder}"
29+
],
30+
"outFiles": [
31+
"${workspaceFolder}/out/**/*.js"
32+
],
33+
"preLaunchTask": "compile_build",
34+
"env": {
35+
"DEBUG": "true"
36+
},
37+
"sourceMaps": true
38+
},
39+
{
40+
"name": "Extension Tests",
41+
"type": "extensionHost",
42+
"request": "launch",
43+
"args": [
44+
"--extensionDevelopmentPath=${workspaceFolder}",
45+
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
46+
],
47+
"outFiles": [
48+
"${workspaceFolder}/out/test/**/*.js"
49+
],
50+
"preLaunchTask": "${defaultBuildTask}"
51+
}
52+
]
53+
}

.vscode/tasks.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@
1515
"kind": "build",
1616
"isDefault": true
1717
}
18+
},
19+
{
20+
"label": "compile_build",
21+
"type": "npm",
22+
"script": "esbuild-watch",
23+
"problemMatcher": "$tsc-watch",
24+
"isBackground": true,
25+
"presentation": {
26+
"reveal": "never"
27+
},
28+
"group": {
29+
"kind": "build",
30+
"isDefault": true
31+
}
1832
}
1933
]
2034
}

config/.DS_Store

6 KB
Binary file not shown.

0 commit comments

Comments
 (0)