Skip to content

Commit 814c8ad

Browse files
committed
CI Improvements
1. Use newer node.js 18.16.0 2. Use Azure Pipelines cache@2 for faster npm installations 3. Compute ESY_BASH_VERSION variable for pipeline releases 4. Add display names for tasks
1 parent 5e887db commit 814c8ad

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

.ci/esy-build-steps.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,43 @@
1+
---
12
# Cross-platform set of build steps for building esy projects
23

34
steps:
45
- task: NodeTool@0
56
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
721
- script: npm i -g esy
22+
displayName: Installing esy
823
- script: npm install
24+
displayName: Installing NPM dependencies
925
- script: npm run build-exe
26+
displayName: Building EsyBash.exe
1027
- script: npm run build-cygwin
11-
displayName: 'Build cygwin'
28+
displayName: Download and setup Cygwin
1229
# - script: npm run test-exe # Skipped because inline tests dont work on Windows without sys/time.h
1330
- script: npm run test
1431
displayName: "npm run test: before packing"
1532
- script: npm run package-cygwin
16-
displayName: "Package cygwin"
33+
displayName: "Consolidate links and package cygwin"
1734
- bash: npm pack
18-
displayName: "npm pack"
35+
displayName: "NPM packing"
1936
- task: PublishBuildArtifacts@1
2037
displayName: 'Release Package'
2138
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)
2441
- script: node postinstall.js
2542
displayName: "node postinstall.js (iteration 1)"
2643
- script: npm run test

0 commit comments

Comments
 (0)