Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/tips options #8

Merged
merged 12 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .github/.DS_Store
Binary file not shown.
29 changes: 29 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: pr-check
on:
pull_request:
paths:
- "**.yml"
- "src/**"
- "config/**"
- "resource/**"
- "package.json"

jobs:
pr-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
- run: npm install
- name: Run headless test
uses: coactions/setup-xvfb@v1
if: runner.os == 'Linux'
with:
run: xvfb-run -a npm test
- name: Run test
run: npm test
if: runner.os != 'Linux'
51 changes: 51 additions & 0 deletions .github/workflows/pre-release-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: pre-release-tag
on:
pull_request:
paths:
- "**.yml"
- "src/**"
- "config/**"
- "resource/**"
- "package.json"
types:
- labeled

jobs:
pre-release-tag:
if: ${{ github.event.label.name == 'pre-release' }}
permissions:
contents: write
runs-on: ubuntu-latest
environment: RELEASE_ENV
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
- run: npm ci

- name: Set Git identity
run: |
git config user.email "[email protected]"
git config user.name "nickyinluo"

- name: Get Current Version
id: vscode-ext-pkg-ver
uses: martinbeentjes/[email protected]

- name: "Automated Version Bump"
id: version-bump
uses: "phips28/gh-action-bump-version@master"
with:
tag-prefix: "v"
version-type: "patch"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Output NEW_TAG"
env:
NEW_TAG: ${{ steps.version-bump.outputs.newTag }}
OLD_VER: ${{ steps.vscode-ext-pkg-ver.outputs.current-version }}
run: echo "new tag[$NEW_TAG], old version[$OLD_VER]"
66 changes: 50 additions & 16 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,66 @@
name: pre-release
on:
pull_request:
types:
- closed
push:
branches:
- master
tags:
- v*
- v*.*.*
- "v*"

jobs:
build:
pre-release:
if: github.event.pull_request.merged == true || startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
environment: RELEASE_ENV
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
- run: npm install
- name: Run headless test
uses: coactions/setup-xvfb@v1
if: runner.os == 'Linux'
with:
run: xvfb-run -a npm test
- run: npm test
if: runner.os != 'Linux'
- name: Pre release
if: success() && startsWith(github.ref, 'refs/tags/')
run: vsce package --no-yarn
- run: npm ci

- name: Set tags from commit tag
if: startsWith(github.ref, 'refs/tags/')
run: |
NEW_TAG=${GITHUB_REF#refs/tags/}
echo "NEW_TAG=$NEW_TAG" >> $GITHUB_ENV
echo "new tag[${{ env.NEW_TAG }}] from commit tag will be set"

- name: Get Current Version
id: vscode-ext-pkg-ver
uses: martinbeentjes/[email protected]

- name: Set tags from label
if: startsWith(github.ref, 'refs/heads/')
run: |
echo "NEW_TAG=${{ steps.vscode-ext-pkg-ver.outputs.current-version}}" >> $GITHUB_ENV
echo "new tag [${{ env.NEW_TAG }}] from label will be set"

- run: echo "NEW_TAG:[${{ env.NEW_TAG }}]"

- name: Set Git identity
run: |
git config user.email "[email protected]"
git config user.name "nickyinluo"

- name: Package extension
if: success()
run: |
npm run package.current
env:
VSCE_PAT: ${{ secrets.VS_MARKETPLACE_TOKEN }}

- name: Pre-release to Github
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ env.NEW_TAG }}
prerelease: true
title: "v${{ env.NEW_TAG }}-beta"
files: |
vscode-tencentcloud-terraform-*.vsix
38 changes: 31 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,48 @@
name: release
on:
push:
branches:
- master
release:
types:
- created
- released

jobs:
release:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
environment: TOKEN_VSCODE
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Publish to vs marketplace
if: success() && startsWith(github.ref, 'refs/tags/')
run: npm run release
- run: npm ci

- name: Set Git identity
run: |
git config user.email "[email protected]"
git config user.name "nickyinluo"

- name: Publish to VS Marketplace
if: success()
run: |
npm run package.current
npm run release.current
env:
VSCE_PAT: ${{ secrets.VS_MARKETPLACE_TOKEN }}

- name: Get Current Version
id: vscode-ext-pkg-ver
uses: martinbeentjes/[email protected]

- name: Releaes to Github
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ steps.vscode-ext-pkg-ver.outputs.current-version}}
prerelease: false
title: "v${{ steps.vscode-ext-pkg-ver.outputs.current-version}}"
files: |
vscode-tencentcloud-terraform-*.vsix
76 changes: 46 additions & 30 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,51 @@
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}",
"env": {
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}",
"env": {
"DEBUG": "true" // <---- EXAMPLE ENVIRONMENT VARIABLE
}
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
},
{
"name": "Debug Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "compile_build",
"env": {
"DEBUG": "true"
},
"sourceMaps": true
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
14 changes: 14 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@
"kind": "build",
"isDefault": true
}
},
{
"label": "compile_build",
"type": "npm",
"script": "esbuild-watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Binary file added config/.DS_Store
Binary file not shown.
Loading
Loading