Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build to use a local package cache from a submodule and build offline #53975

Merged
merged 4 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 .azure/pipelines/components-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
displayName: Update submodules
- script: ./restore.sh
displayName: Run restore.sh
- script: npm ci
- script: npm ci --offline
displayName: NPM install
- script: npm run build
displayName: Build JS
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
path = src/submodules/MessagePack-CSharp
url = https://github.com/aspnet/MessagePack-CSharp.git
branch = master
[submodule "Node-Externals"]
path = src/submodules/Node-Externals
url = https://github.com/dotnet/Node-Externals
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
registry=https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/
cache=./src/submodules/node-externals/cache
always-auth=true
9 changes: 7 additions & 2 deletions eng/Npm.Workspace.nodeproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@
<PackageVersion>$(VersionPrefix)$(VersionSuffix)</PackageVersion>
</PropertyGroup>

<Target Name="Restore">
<Target Name="_VerifyNPMCache">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@javiercn is this the right time to call npm cache verify (before Restore)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep

<Message Text="Verifying NPM cache..." Importance="high" />
<Exec Command="npm cache verify" WorkingDirectory="$(MSBuildThisFileDirectory).." />
</Target>

<Target Name="Restore" DependsOnTargets="_VerifyNPMCache">
<Message Text="Restoring NPM packages..." Importance="high" />
<Exec Command="npm ci" WorkingDirectory="$(MSBuildThisFileDirectory).." />
<Exec Command="npm ci --offline" WorkingDirectory="$(MSBuildThisFileDirectory).." />

Check failure on line 25 in eng/Npm.Workspace.nodeproj

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: Ubuntu x64)

eng/Npm.Workspace.nodeproj#L25

eng/Npm.Workspace.nodeproj(25,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Restore) The command "npm ci --offline" exited with code 1.

Check failure on line 25 in eng/Npm.Workspace.nodeproj

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Build: Linux x64)

eng/Npm.Workspace.nodeproj#L25

eng/Npm.Workspace.nodeproj(25,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Restore) The command "npm ci --offline" exited with code 1.

Check failure on line 25 in eng/Npm.Workspace.nodeproj

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Build: Linux Musl ARM)

eng/Npm.Workspace.nodeproj#L25

eng/Npm.Workspace.nodeproj(25,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Restore) The command "npm ci --offline" exited with code 1.

Check failure on line 25 in eng/Npm.Workspace.nodeproj

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Build: Linux Musl ARM64)

eng/Npm.Workspace.nodeproj#L25

eng/Npm.Workspace.nodeproj(25,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Restore) The command "npm ci --offline" exited with code 1.

Check failure on line 25 in eng/Npm.Workspace.nodeproj

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: Ubuntu x64)

eng/Npm.Workspace.nodeproj#L25

eng/Npm.Workspace.nodeproj(25,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Restore) The command "npm ci --offline" exited with code 1.
</Target>

<Target Name="Build">
Expand Down
2 changes: 1 addition & 1 deletion eng/SourceBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@
Command="npm --version"
WorkingDirectory="$(InnerSourceBuildRepoRoot)" />

<Exec

Check failure on line 110 in eng/SourceBuild.props

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Source-Build (Managed))

eng/SourceBuild.props#L110

eng/SourceBuild.props(110,5): error MSB3073: The command "npm ci --offline" exited with code 1.
Command="npm ci"
Command="npm ci --offline"
WorkingDirectory="$(InnerSourceBuildRepoRoot)" />

</Target>
Expand Down
1 change: 1 addition & 0 deletions src/submodules/Node-Externals
Submodule Node-Externals added at cfdec6
Loading