From 7d71349be7280596613ac16cbb8207fedd2470ad Mon Sep 17 00:00:00 2001 From: Li Yilong Date: Thu, 21 Jan 2021 16:37:12 +0800 Subject: [PATCH] add vsce publish in ci --- .github/workflows/ci.yaml | 58 +++++++++++++++++++++++++++++---------- README.md | 2 ++ package.json | 6 ++-- 3 files changed, 49 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3120dc4..1a61742 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,8 +7,18 @@ on: pull_request: branches: - master + release: + types: + - created jobs: - build: + debug: + runs-on: ubuntu-latest + steps: + - name: Print context + run: | + echo "github.ref: ${{ github.ref }}" + echo "github.event_name : ${{ github.event_name }}" + test: strategy: matrix: os: [macos-latest, ubuntu-latest, windows-latest] @@ -18,17 +28,35 @@ jobs: node: 10 runs-on: ${{ matrix.os }} steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install Node.js - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - - name: Install dependencies - run: npm install - - name: Test (Linux) - if: runner.os == 'Linux' - run: xvfb-run -a npm test - - name: Test (macOS, Windows) - if: runner.os != 'Linux' - run: npm test + - name: Checkout + uses: actions/checkout@v2 + - name: Install Node.js + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - name: Install dependencies + run: npm install + - name: Test on Linux + if: runner.os == 'Linux' + run: xvfb-run -a npm test + - name: Test on macOS, Windows + if: runner.os != 'Linux' + run: npm test + publish: + needs: + - test + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install Node.js + uses: actions/setup-node@v1 + with: + node-version: 14 + - name: Install dependencies + run: npm install + - name: Publish + if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') + run: npm run deploy + env: + VSCE_PAT: ${{ secrets.VSCE_PAT }} diff --git a/README.md b/README.md index 8a77da8..83fe21d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # TiDE +![ci](https://github.com/dragonly/ticode/workflows/ci/badge.svg) + TiDE is a Visual Studio Code extension that makes developing TiDB a breeze. Still in the loop of coding, compiling, copying binary to servers, restarting every process and pulling information from logs everywhere? diff --git a/package.json b/package.json index a439764..3d12eb9 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ }, "description": "make developing TiDB a breeze", "icon": "media/logo.png", - "version": "0.2.1", + "version": "0.2.2", "engines": { "vscode": "^1.52.0" }, @@ -359,7 +359,8 @@ "pretest": "npm run compile && npm run lint", "lint": "eslint src --ext ts", "test": "node ./out/test/runTest.js", - "fmt": "prettier --write ." + "fmt": "prettier --write .", + "deploy": "vsce publish" }, "devDependencies": { "@types/glob": "^7.1.3", @@ -374,6 +375,7 @@ "mocha": "^8.1.3", "prettier": "^2.2.1", "typescript": "^4.1.2", + "vsce": "^1.84.0", "vscode-test": "^1.4.1" }, "dependencies": {