Skip to content

Commit

Permalink
adopt publish pipeline (#16)
Browse files Browse the repository at this point in the history
* adopt publish pipeline

* use prepack

* update pipeline
  • Loading branch information
aeschli authored Nov 3, 2022
1 parent a4ae2b3 commit 0740997
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 9 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
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
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 @@ -33,10 +33,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"
}
}

0 comments on commit 0740997

Please sign in to comment.