Skip to content

Commit 4d870c2

Browse files
authored
Merge pull request #8 from libeo-tech/continuous-deployment
Continuous deployment
2 parents a8e5a4b + 77d9a30 commit 4d870c2

4 files changed

Lines changed: 773 additions & 11 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish extension
2+
on:
3+
push:
4+
branches:
5+
- main
6+
release:
7+
types:
8+
- created
9+
10+
jobs:
11+
build:
12+
strategy:
13+
matrix:
14+
os: [macos-latest, ubuntu-latest, windows-latest]
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
- name: Install Node.js
20+
uses: actions/setup-node@v1
21+
with:
22+
node-version: 10.x
23+
- run: npm install
24+
- run: xvfb-run -a npm test
25+
if: runner.os == 'Linux'
26+
- run: npm test
27+
if: runner.os != 'Linux'
28+
- name: Publish
29+
if: success() && startsWith( github.ref, 'refs/tags/releases/') && matrix.os == 'ubuntu-latest'
30+
run: npm run deploy
31+
env:
32+
VSCE_PAT: ${{ secrets.VSCE_PAT }}
33+
SEGMENT_KEY: ${{ secrets.SEGMENT_KEY }}
34+

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
"watch": "tsc -watch -p ./",
7171
"pretest": "yarn run compile && yarn run lint",
7272
"lint": "eslint src --ext ts",
73-
"test": "node ./out/test/runTest.js"
73+
"test": "node ./out/test/runTest.js",
74+
"deploy": "vsce publish --yarn"
7475
},
7576
"devDependencies": {
7677
"@types/glob": "^7.1.3",
@@ -83,6 +84,7 @@
8384
"glob": "^7.1.6",
8485
"mocha": "^8.2.1",
8586
"typescript": "^4.1.3",
87+
"vsce": "^2.7.0",
8688
"vscode-test": "^1.5.0"
8789
},
8890
"dependencies": {

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as FileUtils from './file-utils';
55
import * as Snippets from "./snippets";
66
import { kebabCasify, stringToUintArray } from './utils/string-manipulation';
77

8-
var analytics = new Analytics('KEY_HERE');
8+
var analytics = new Analytics(process.env.SEGMENT_KEY || "");
99

1010
async function onCreateDirectories(selectedFolder: vscode.Uri) {
1111
analytics.track({

0 commit comments

Comments
 (0)