Skip to content

Commit 9861fa6

Browse files
authored
[Infastructure] Update build to use a local npm package cache from a submodule and build offline (#53975)
* Update build to use a local package cache from a submodule and build 'offline'
1 parent 43f49bc commit 9861fa6

File tree

11 files changed

+17
-8
lines changed

11 files changed

+17
-8
lines changed

.azure/pipelines/components-e2e-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
displayName: Update submodules
4242
- script: ./restore.sh
4343
displayName: Run restore.sh
44-
- script: npm ci
44+
- script: npm ci --offline
4545
displayName: NPM install
4646
- script: npm run build
4747
displayName: Build JS

.github/dependabot.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ updates:
4545
commit-message:
4646
prefix: "[main] "
4747
include: scope
48+
ignore:
49+
# Don't auto-update the Node-Externals submodule
50+
- dependency-name: "Node-Externals*"
4851
labels:
4952
- area-infrastructure
5053

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@
66
path = src/submodules/MessagePack-CSharp
77
url = https://github.com/aspnet/MessagePack-CSharp.git
88
branch = master
9+
[submodule "Node-Externals"]
10+
path = src/submodules/Node-Externals
11+
url = https://github.com/dotnet/Node-Externals

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
registry=https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/
2+
cache=./src/submodules/Node-Externals/cache
23
always-auth=true

eng/Npm.Workspace.nodeproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@
1515
<PackageVersion>$(VersionPrefix)$(VersionSuffix)</PackageVersion>
1616
</PropertyGroup>
1717

18-
<Target Name="Restore">
18+
<Target Name="_VerifyNPMCache">
19+
<Message Text="Verifying NPM cache..." Importance="high" />
20+
<Exec Command="npm cache verify" WorkingDirectory="$(MSBuildThisFileDirectory).." />
21+
</Target>
22+
23+
<Target Name="Restore" DependsOnTargets="_VerifyNPMCache">
1924
<Message Text="Restoring NPM packages..." Importance="high" />
20-
<Exec Command="npm ci" WorkingDirectory="$(MSBuildThisFileDirectory).." />
25+
<Exec Command="npm ci --offline" WorkingDirectory="$(MSBuildThisFileDirectory).." />
2126
</Target>
2227

2328
<Target Name="Build">

eng/SourceBuild.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
WorkingDirectory="$(InnerSourceBuildRepoRoot)" />
109109

110110
<Exec
111-
Command="npm ci"
111+
Command="npm ci --offline"
112112
WorkingDirectory="$(InnerSourceBuildRepoRoot)" />
113113

114114
</Target>

src/Components/Web.JS/dist/Release/blazor.server.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/Components/Web.JS/dist/Release/blazor.web.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/Components/Web.JS/dist/Release/blazor.webassembly.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/Components/Web.JS/dist/Release/blazor.webview.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)