Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Global rule:
* @microsoft/akvelon-build-task-team @microsoft/azure-pipelines-platform
* @microsoft/azure-pipelines-tasks-and-agent @microsoft/azure-pipelines-platform
14 changes: 8 additions & 6 deletions .github/workflows/autoAssignABTT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ name: Auto Assign ABTT to Project Board

on:
issues:
types: [opened]
env:
MY_GITHUB_TOKEN: ${{ secrets.ABTT_TOKEN }}
types:
- opened

jobs:
assign_one_project:
runs-on: ubuntu-latest
permissions:
issues: write
name: Assign to ABTT Project
steps:
- name: "Add triage and area labels"
Expand All @@ -18,8 +19,9 @@ jobs:
labels: |
Area: RestClient
triage

- name: "Assign issues with 'Area: ABTT' label to project board"
uses: srggrs/assign-one-project-github-action@1.2.0
uses: actions/add-to-project@v0.4.1
with:
project: 'https://github.com/orgs/microsoft/projects/48'
column_name: 'Backlog'
project-url: https://github.com/orgs/microsoft/projects/755
github-token: ${{ secrets.ABTT_TOKEN }}
3 changes: 2 additions & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
stale:

runs-on: ubuntu-latest

permissions:
issues: write
steps:
- uses: actions/stale@v1
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
typings
node_modules
_build
.vscode
lib/*.js
samples/*.js
samples/*.txt
Expand Down
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
registry=https://pkgs.dev.azure.com/mseng/PipelineTools/_packaging/PipelineTools_PublicPackages/npm/registry/

always-auth=true
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ set NODE_DEBUG=http

## Node support

The typed-rest-client is built using the latest LTS version of Node 8. We also support the latest LTS for Node 6 and newer.
v2 - [current, maintained] - Supports node 16 and above
v1 - End Of Life, for Node < 16, contains security vulnerabilities, use at your own risk

## Contributing

Expand Down
174 changes: 129 additions & 45 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,131 @@
pool:
vmImage: ubuntu-20.04
# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.
# This pipeline will be extended to the OneESPT template

trigger:
- master
- releases/*
variables:
isMaster: $[eq(variables['Build.SourceBranch'], 'refs/heads/master')]
isRelease: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/releases')]
parameters:
- name: versionSpec
type: object
default:
- '6.x'
- '8.x'
- '10.x'
- '12.x'
- '14.x'
- '16.x'

jobs:
- job: build_test_and_publish
displayName: Build, test and publish
steps:
#build on node 8.x
- task: NodeTool@0
inputs:
versionSpec: '8.x'
displayName: Install node

- script: npm install
displayName: npm install

- script: npm run build
displayName: npm run build
#run unit tests on different node versions
- ${{ each version in parameters.versionSpec }}:
- task: NodeTool@0
inputs:
versionSpec: ${{ version }}
displayName: Install node
- script: npm run units
displayName: npm run units
- script: npm run test
displayName: npm run test
#publish if needed
- task: PublishBuildArtifacts@1
condition: and(succeeded(), in(variables['publishBuild'], 'true'))
inputs:
PathtoPublish: "_build"
ArtifactName: "drop"
ArtifactType: "Container"
displayName: Publish build artifacts
- name: nodeVersionList
type: object
default: [16, 18, 20]
- name: imageList
type: object
default:
windows: 'abtt-windows-2025'
linux: 'abtt-ubuntu-2404'
- name: publishToNpm
displayName: Publish to npm
type: boolean
default: false
resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
sdl:
sbom:
enabled: false
sourceAnalysisPool:
name: 1ES-ABTT-Shared-Pool
image: abtt-windows-2025
os: windows
customBuildTags:
- ES365AIMigrationTooling
stages:
- stage: Build
displayName: Build typed-rest-client
jobs:
- job: Build_and_Publish
displayName: Build and Publish artifact
pool:
name: 1ES-ABTT-Shared-Pool
image: abtt-ubuntu-2404
os: linux
templateContext:
outputs:
- output: pipelineArtifact
displayName: 'Publish _build artifact'
targetPath: _build
artifactType: pipeline
artifactName: _build
steps:
- task: NodeTool@0
inputs:
versionSpec: '20.x'
displayName: Install node 20.x
- task: NpmAuthenticate@0
inputs:
workingFile: .npmrc
- script: npm install
displayName: npm install
- script: npm run build
displayName: npm run build
- stage: Test
displayName: Test typed-rest-client
jobs:
- ${{ each image in parameters.imageList }}:
- ${{ each nodeVersion in parameters.nodeVersionList }}:
- job: Node_os_${{ nodeVersion }}_${{ image.key }}
displayName: Node.js ${{ nodeVersion }} on ${{ image.key }}
pool:
name: 1ES-ABTT-Shared-Pool
image: ${{ image.value }}
os: ${{ image.key }}
steps:
- task: DownloadPipelineArtifact@2
displayName: Download built typed-rest-client package
inputs:
artifact: _build
path: $(Build.SourcesDirectory)/_build
patterns: '!package-lock.json'
- script: npm install
displayName: npm install
- task: NodeTool@0
inputs:
versionSpec: ${{ nodeVersion }}.x
displayName: Install node ${{ nodeVersion }}
- script: npm run units
displayName: npm run units
- script: npm run test
displayName: npm run test
- stage: Publish
condition: and(succeeded(), or(eq('${{ parameters.publishToNpm }}', true), eq(variables.isRelease, true), eq(variables.isMaster, true)))
jobs:
- job: Publish_package
displayName: Publish npm package
pool:
name: 1ES-ABTT-Shared-Pool
image: abtt-ubuntu-2404
os: linux
steps:
- task: DownloadPipelineArtifact@2
displayName: Download built typed-rest-client package
inputs:
artifact: _build
path: $(Build.SourcesDirectory)/_build
- task: Npm@1
displayName: Publish typed-rest-client to npm
inputs:
command: publish
workingDir: '_build'
publishRegistry: useExternalRegistry
publishEndpoint: btt-npm-publish-token
continueOnError: true
- script: npm install
displayName: npm install
continueOnError: true
condition: and(succeeded(), eq(variables.isMaster, true))
- script: node ./ci/create-release-notes.js
continueOnError: true
condition: and(succeeded(), eq(variables.isMaster, true))
env:
GH_TOKEN: $(githubToken)
branch: $(Build.SourceBranchName)
displayName: Create Release
Loading