Skip to content

Commit 4fa9c85

Browse files
authored
add publish pipeline & cleanup ci (#71)
* add publish pipeline & cleanup ci * remove tag updating in post-publish * use prepack, update pipeline
1 parent 852e855 commit 4fa9c85

File tree

9 files changed

+110
-52
lines changed

9 files changed

+110
-52
lines changed

.github/workflows/pr-chat.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: PR Chat
2+
on:
3+
pull_request_target:
4+
types: [opened, ready_for_review, closed]
5+
6+
jobs:
7+
main:
8+
runs-on: ubuntu-latest
9+
if: ${{ !github.event.pull_request.draft }}
10+
steps:
11+
- name: Checkout Actions
12+
uses: actions/checkout@v2
13+
with:
14+
repository: "microsoft/vscode-github-triage-actions"
15+
ref: stable
16+
path: ./actions
17+
- name: Install Actions
18+
run: npm install --production --prefix ./actions
19+
- name: Run Code Review Chat
20+
uses: ./actions/code-review-chat
21+
with:
22+
token: ${{secrets.GITHUB_TOKEN}}
23+
slack_token: ${{ secrets.SLACK_TOKEN }}
24+
slack_bot_name: "VSCodeBot"
25+
notification_channel: codereview

.github/workflows/tests.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
on: [push]
2+
3+
name: Tests
4+
5+
jobs:
6+
build:
7+
strategy:
8+
matrix:
9+
os: [macos-latest, ubuntu-latest, windows-latest]
10+
runs-on: ${{ matrix.os }}
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- name: Install Node.js
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: 16.x
18+
- name: Install root project dependencies
19+
run: npm install
20+
- name: Build and run tests
21+
run: npm test

.travis.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.vscode/launch.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
99
"stopOnEntry": false,
1010
"args": [
11+
"./lib/umd/test",
1112
"--timeout",
1213
"999999",
1314
"--colors"

.vscode/settings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"git.branchProtection": [
3+
"main"
4+
],
5+
"git.branchProtectionPrompt": "alwaysCommitToNewBranch",
6+
"git.branchRandomName.enable": true,
7+
"githubPullRequests.assignCreated": "${user}",
8+
"githubPullRequests.defaultMergeMethod": "squash"
9+
}

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ Scanner and parser for JSON with comments.
33

44
[![npm Package](https://img.shields.io/npm/v/jsonc-parser.svg?style=flat-square)](https://www.npmjs.org/package/jsonc-parser)
55
[![NPM Downloads](https://img.shields.io/npm/dm/jsonc-parser.svg)](https://npmjs.org/package/jsonc-parser)
6-
[![Build Status](https://travis-ci.org/microsoft/node-jsonc-parser.svg?branch=main)](https://travis-ci.org/Microsoft/node-jsonc-parser)
6+
[![Build Status](https://github.com/microsoft/node-jsonc-parser/workflows/Tests/badge.svg)](https://github.com/microsoft/node-jsonc-parser/workflows/Tests)
7+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
78

89
Why?
910
----

build/pipeline.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: $(Date:yyyyMMdd)$(Rev:.r)
2+
3+
trigger:
4+
branches:
5+
include:
6+
- main
7+
pr: none
8+
9+
resources:
10+
repositories:
11+
- repository: templates
12+
type: github
13+
name: microsoft/vscode-engineering
14+
ref: main
15+
endpoint: Monaco
16+
17+
parameters:
18+
- name: publishPackage
19+
displayName: 🚀 Publish jsonc-parser
20+
type: boolean
21+
default: false
22+
23+
extends:
24+
template: azure-pipelines/npm-package/pipeline.yml@templates
25+
parameters:
26+
npmPackages:
27+
- name: jsonc-parser
28+
29+
testPlatforms:
30+
- name: Linux
31+
nodeVersions:
32+
- 16.x
33+
- name: MacOS
34+
nodeVersions:
35+
- 16.x
36+
- name: Windows
37+
nodeVersions:
38+
- 16.x
39+
40+
buildSteps:
41+
- script: npm ci
42+
displayName: Install dependencies
43+
44+
testSteps:
45+
- script: npm ci
46+
displayName: Install dependencies
47+
- script: npm test
48+
displayName: Test npm package
49+
50+
publishPackage: ${{ parameters.publishPackage }}

build/post-publish.js

Lines changed: 0 additions & 41 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,13 @@
2525
"rimraf": "^3.0.2"
2626
},
2727
"scripts": {
28-
"prepublishOnly": "npm run clean && npm run compile-esm && npm run test && npm run remove-sourcemap-refs",
29-
"postpublish": "node ./build/post-publish.js",
28+
"prepack": "npm run clean && npm run compile-esm && npm run test && npm run remove-sourcemap-refs",
3029
"compile": "tsc -p ./src && npm run lint",
3130
"compile-esm": "tsc -p ./src/tsconfig.esm.json",
3231
"remove-sourcemap-refs": "node ./build/remove-sourcemap-refs.js",
3332
"clean": "rimraf lib",
3433
"watch": "tsc -w -p ./src",
3534
"test": "npm run compile && mocha ./lib/umd/test",
36-
"lint": "eslint src/**/*.ts",
37-
"preversion": "npm test",
38-
"postversion": "git push && git push --tags"
35+
"lint": "eslint src/**/*.ts"
3936
}
4037
}

0 commit comments

Comments
 (0)