Skip to content
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
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.test.js
*.test.ts
_manifest/
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"build": "tsc -b ./src/tsconfig.json",
"watch": "tsc -b -w ./src/tsconfig.json",
"lint": "eslint -c .eslintrc.js --ext .ts src/",
"install": "node scripts/prebuild.js || node-gyp rebuild",
"postinstall": "node scripts/post-install.js",
"compileCommands": "node scripts/gen-compile-commands.js",
"test": "cross-env NODE_ENV=test mocha -R spec --exit lib/*.test.js",
Expand Down
77 changes: 62 additions & 15 deletions pipelines/prebuilds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extends:
stages:
- stage: Build
jobs:
- job: windows-x64
- job: win32_x64
pool:
name: 1es-windows-2022-x64
os: windows
Expand All @@ -31,8 +31,9 @@ extends:
artifactName: 'win32-x64'
steps:
- template: pipelines/build.yml@self
arch: x64
- job: windows-arm64
parameters:
arch: x64
- job: win32_arm64
pool:
name: 1es-windows-2022-x64
os: windows
Expand All @@ -43,8 +44,9 @@ extends:
artifactName: 'win32-arm64'
steps:
- template: pipelines/build.yml@self
arch: arm64
- job: macOS-x64
parameters:
arch: arm64
- job: macOS_x64
pool:
name: Azure Pipelines
vmImage: macOS-latest
Expand All @@ -53,11 +55,12 @@ extends:
outputs:
- output: pipelineArtifact
targetPath: $(Build.SourcesDirectory)/build/Release
artifactName: 'macOS-x64'
artifactName: 'darwin-x64'
steps:
- template: pipelines/build.yml@self
arch: x64
- job: macOS-arm64
parameters:
arch: x64
- job: macOS_arm64
pool:
name: Azure Pipelines
vmImage: macOS-latest
Expand All @@ -66,11 +69,12 @@ extends:
outputs:
- output: pipelineArtifact
targetPath: $(Build.SourcesDirectory)/build/Release
artifactName: 'macOS-arm64'
artifactName: 'darwin-arm64'
steps:
- template: pipelines/build.yml@self
arch: arm64
- job: linux-x64
parameters:
arch: arm64
- job: linux_x64
pool:
name: 1es-ubuntu-22.04-x64
os: linux
Expand All @@ -81,10 +85,11 @@ extends:
artifactName: 'linux-x64'
steps:
- template: pipelines/build.yml@self
arch: x64
- job: linux-arm64
parameters:
arch: x64
- job: linux_arm64
pool:
name: 1es-mariner-2.0-arm64
name: 1es-ubuntu-22.04-x64
os: linux
templateContext:
outputs:
Expand All @@ -93,4 +98,46 @@ extends:
artifactName: 'linux-arm64'
steps:
- template: pipelines/build.yml@self
arch: arm64
parameters:
arch: arm64

- stage: Archive
jobs:
- job: archive
pool:
name: 1es-ubuntu-22.04-x64
os: linux
templateContext:
inputs:
- input: pipelineArtifact
artifactName: win32-x64
targetPath: $(Build.ArtifactStagingDirectory)/win32-x64
- input: pipelineArtifact
artifactName: win32-arm64
targetPath: $(Build.ArtifactStagingDirectory)/win32-arm64
- input: pipelineArtifact
artifactName: darwin-x64
targetPath: $(Build.ArtifactStagingDirectory)/darwin-x64
- input: pipelineArtifact
artifactName: darwin-arm64
targetPath: $(Build.ArtifactStagingDirectory)/darwin-arm64
- input: pipelineArtifact
artifactName: linux-x64
targetPath: $(Build.ArtifactStagingDirectory)/linux-x64
- input: pipelineArtifact
artifactName: linux-arm64
targetPath: $(Build.ArtifactStagingDirectory)/linux-arm64
outputs:
- output: pipelineArtifact
targetPath: $(Build.ArtifactStagingDirectory)/prebuilds
artifactName: 'prebuilds'
steps:
- script: |
mkdir -p $(Build.ArtifactStagingDirectory)/prebuilds
cp -r $(Build.ArtifactStagingDirectory)/win32-x64 $(Build.ArtifactStagingDirectory)/prebuilds/
cp -r $(Build.ArtifactStagingDirectory)/win32-arm64 $(Build.ArtifactStagingDirectory)/prebuilds/
cp -r $(Build.ArtifactStagingDirectory)/darwin-x64 $(Build.ArtifactStagingDirectory)/prebuilds/
cp -r $(Build.ArtifactStagingDirectory)/darwin-arm64 $(Build.ArtifactStagingDirectory)/prebuilds/
cp -r $(Build.ArtifactStagingDirectory)/linux-x64 $(Build.ArtifactStagingDirectory)/prebuilds/
cp -r $(Build.ArtifactStagingDirectory)/linux-arm64 $(Build.ArtifactStagingDirectory)/prebuilds/
displayName: 'Create prebuilds archive'
16 changes: 16 additions & 0 deletions publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ extends:
- name: node-pty

buildSteps:
- task: DownloadPipelineArtifact@2
displayName: 'Download prebuilds'
inputs:
pipeline: '647'
runVersion: 'latestFromBranch'
runBranch: 'main'
artifact: 'prebuilds'
targetPath: 'prebuilds'
- script: npm ci
displayName: 'Install dependencies and build'
# The following script leaves the version unchanged for
Expand All @@ -47,6 +55,14 @@ extends:
displayName: 'Increment version'

testSteps:
- task: DownloadPipelineArtifact@2
displayName: 'Download prebuilds'
inputs:
pipeline: '647'
runVersion: 'latestFromBranch'
runBranch: 'main'
artifact: 'prebuilds'
targetPath: 'prebuilds'
- script: npm ci
displayName: 'Install dependencies and build'
- script: npm test
Expand Down
6 changes: 6 additions & 0 deletions scripts/prebuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ const path = require('path');
* node scripts/prebuild.js
*/

// Skip copying prebuilds when npm_config_build_from_source is set
if (process.env.npm_config_build_from_source === 'true') {
console.log('\x1b[33m> Skipping prebuild copy because npm_config_build_from_source is set\x1b[0m');
process.exit(1);
}

const PREBUILD_DIR = path.join(__dirname, '..', 'prebuilds', `${process.platform}-${process.arch}`);
const RELEASE_DIR = path.join(__dirname, '../build/Release');

Expand Down