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

adopt publish pipeline #16

Merged
merged 3 commits into from
Nov 3, 2022
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
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
10 changes: 4 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16.x
- name: Install root project dependencies
run: npm install
- name: Build and run tests
uses: GabrielBB/[email protected]
with:
run: npm test
run: npm test
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"
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![npm Package](https://img.shields.io/npm/v/request-light.svg?style=flat-square)](https://www.npmjs.org/package/request-light)
[![NPM Downloads](https://img.shields.io/npm/dm/request-light.svg)](https://npmjs.org/package/request-light)
[![Build Status](https://github.com/microsoft/node-request-light/workflows/Tests/badge.svg)](https://github.com/microsoft/node-request-light/workflows/Tests)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A lightweight request library intended to be used by VSCode extensions.
- NodeJS and browser main entry points
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 request-light
type: boolean
default: false

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

buildSteps:
- script: npm ci
displayName: Install dependencies

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

testSteps:
- script: npm ci
displayName: Install dependencies
- script: npm test
lszomoru marked this conversation as resolved.
Show resolved Hide resolved
displayName: Test npm package

publishPackage: ${{ parameters.publishPackage }}
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@
"scripts": {
"compile": "webpack",
"watch": "webpack --watch",
"package": "webpack --mode production --devtool hidden-source-map",
"prepublishOnly": "npm run clean && npm run package && tsc -p ./src/test/ && ava ./lib/test/test.js",
"bundle": "webpack --mode production --devtool hidden-source-map",
"prepack": "npm run clean && npm run bundle && tsc -p ./src/test/ && ava ./lib/test/test.js",
"clean": "rimraf lib",
"postversion": "git push && git push --tags",
"test": "npm run compile && tsc -p ./src/test/ && ava ./lib/test/test.js"
}
}