Skip to content

Commit

Permalink
add publish pipeline & cleanup ci (#71)
Browse files Browse the repository at this point in the history
* add publish pipeline & cleanup ci

* remove tag updating in post-publish

* use prepack, update pipeline
  • Loading branch information
aeschli committed Nov 3, 2022
1 parent 852e855 commit 4fa9c85
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 52 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/pr-chat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: PR Chat
on:
pull_request_target:
types: [opened, ready_for_review, closed]

jobs:
main:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Checkout Actions
uses: actions/checkout@v2
with:
repository: "microsoft/vscode-github-triage-actions"
ref: stable
path: ./actions
- name: Install Actions
run: npm install --production --prefix ./actions
- name: Run Code Review Chat
uses: ./actions/code-review-chat
with:
token: ${{secrets.GITHUB_TOKEN}}
slack_token: ${{ secrets.SLACK_TOKEN }}
slack_bot_name: "VSCodeBot"
notification_channel: codereview
21 changes: 21 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on: [push]

name: Tests

jobs:
build:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Install root project dependencies
run: npm install
- name: Build and run tests
run: npm test
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"stopOnEntry": false,
"args": [
"./lib/umd/test",
"--timeout",
"999999",
"--colors"
Expand Down
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"git.branchProtection": [
"main"
],
"git.branchProtectionPrompt": "alwaysCommitToNewBranch",
"git.branchRandomName.enable": true,
"githubPullRequests.assignCreated": "${user}",
"githubPullRequests.defaultMergeMethod": "squash"
}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ Scanner and parser for JSON with comments.

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

Why?
----
Expand Down
50 changes: 50 additions & 0 deletions build/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: $(Date:yyyyMMdd)$(Rev:.r)

trigger:
branches:
include:
- main
pr: none

resources:
repositories:
- repository: templates
type: github
name: microsoft/vscode-engineering
ref: main
endpoint: Monaco

parameters:
- name: publishPackage
displayName: 🚀 Publish jsonc-parser
type: boolean
default: false

extends:
template: azure-pipelines/npm-package/pipeline.yml@templates
parameters:
npmPackages:
- name: jsonc-parser

testPlatforms:
- name: Linux
nodeVersions:
- 16.x
- name: MacOS
nodeVersions:
- 16.x
- name: Windows
nodeVersions:
- 16.x

buildSteps:
- script: npm ci
displayName: Install dependencies

testSteps:
- script: npm ci
displayName: Install dependencies
- script: npm test
displayName: Test npm package

publishPackage: ${{ parameters.publishPackage }}
41 changes: 0 additions & 41 deletions build/post-publish.js

This file was deleted.

7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,13 @@
"rimraf": "^3.0.2"
},
"scripts": {
"prepublishOnly": "npm run clean && npm run compile-esm && npm run test && npm run remove-sourcemap-refs",
"postpublish": "node ./build/post-publish.js",
"prepack": "npm run clean && npm run compile-esm && npm run test && npm run remove-sourcemap-refs",
"compile": "tsc -p ./src && npm run lint",
"compile-esm": "tsc -p ./src/tsconfig.esm.json",
"remove-sourcemap-refs": "node ./build/remove-sourcemap-refs.js",
"clean": "rimraf lib",
"watch": "tsc -w -p ./src",
"test": "npm run compile && mocha ./lib/umd/test",
"lint": "eslint src/**/*.ts",
"preversion": "npm test",
"postversion": "git push && git push --tags"
"lint": "eslint src/**/*.ts"
}
}

0 comments on commit 4fa9c85

Please sign in to comment.