|
| 1 | +--- |
1 | 2 | # Cross-platform set of build steps for building esy projects |
2 | 3 |
|
3 | 4 | steps: |
4 | 5 | - task: NodeTool@0 |
5 | 6 | inputs: |
6 | | - versionSpec: '8.9' |
| 7 | + versionSpec: '18.16.0' |
| 8 | + - bash: | |
| 9 | + NPM_CACHE_DIR=$(npm config get cache) |
| 10 | + ESY_BASH_VERSION=$(node -e 'console.log(require("./package.json").version)') |
| 11 | + echo "##vso[task.setvariable variable=NPM_CACHE_DIR]$NPM_CACHE_DIR" |
| 12 | + echo "##vso[task.setvariable variable=ESY_BASH_VERSION]$ESY_BASH_VERSION" |
| 13 | + displayName: Compute pipeline variables |
| 14 | + - task: Cache@2 |
| 15 | + inputs: |
| 16 | + key: 'npm | "$(Build.SourcesDirectory)/package-lock.json"' |
| 17 | + restoreKeys: | |
| 18 | + npm |
| 19 | + path: $(NPM_CACHE_DIR) |
| 20 | + displayName: Cache NPM |
7 | 21 | - script: npm i -g esy |
| 22 | + displayName: Installing esy |
8 | 23 | - script: npm install |
| 24 | + displayName: Installing NPM dependencies |
9 | 25 | - script: npm run build-exe |
| 26 | + displayName: Building EsyBash.exe |
10 | 27 | - script: npm run build-cygwin |
11 | | - displayName: 'Build cygwin' |
| 28 | + displayName: Download and setup Cygwin |
12 | 29 | # - script: npm run test-exe # Skipped because inline tests dont work on Windows without sys/time.h |
13 | 30 | - script: npm run test |
14 | 31 | displayName: "npm run test: before packing" |
15 | 32 | - script: npm run package-cygwin |
16 | | - displayName: "Package cygwin" |
| 33 | + displayName: "Consolidate links and package cygwin" |
17 | 34 | - bash: npm pack |
18 | | - displayName: "npm pack" |
| 35 | + displayName: "NPM packing" |
19 | 36 | - task: PublishBuildArtifacts@1 |
20 | 37 | displayName: 'Release Package' |
21 | 38 | inputs: |
22 | | - PathtoPublish: './esy-bash-0.3.20.tgz' |
23 | | - ArtifactName: npm-package |
| 39 | + PathtoPublish: './esy-bash-$(ESY_BASH_VERSION).tgz' |
| 40 | + ArtifactName: esy-bash-$(ESY_BASH_VERSION) |
24 | 41 | - script: node postinstall.js |
25 | 42 | displayName: "node postinstall.js (iteration 1)" |
26 | 43 | - script: npm run test |
|
0 commit comments