From 3cf604cafa3d856eec37e9c85b88939d7c58b409 Mon Sep 17 00:00:00 2001 From: Shannon Lewis Date: Wed, 18 May 2022 12:32:44 +1000 Subject: [PATCH] fix: Added node-prune back into the pipeline to reduce the package size (#244) --- .github/workflows/build.yml | 7 +++++++ pack.ps1 | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6b179025..4d35fd8a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,6 +34,7 @@ jobs: with: node-version: '16' cache: 'npm' + - name: Build id: build run: | @@ -63,6 +64,7 @@ jobs: with: node-version: '16' cache: 'npm' + - name: Test run: | npm install @@ -92,6 +94,11 @@ jobs: node-version: '16' cache: 'npm' + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: '^1.17.7' + - name: Embed octo portable run: | pwsh ./embed-octo.ps1 diff --git a/pack.ps1 b/pack.ps1 index c7904b6f..ac68f05e 100644 --- a/pack.ps1 +++ b/pack.ps1 @@ -60,6 +60,12 @@ function SetupTaskDependencies($workingDirectory) { mkdir "$tempPath/node_modules" & npm install --prefix $tempPath azure-pipelines-task-lib azure-pipelines-tool-lib & npm dedup --prefix $tempPath + & go install github.com/tj/node-prune@latest + + $goPath = go env GOPATH + $command = "$goPath/bin/node-prune" + + Invoke-Expression "$command $tempPath/node_modules" $taskManifestFiles = Get-ChildItem $workingDirectory -Include "task.json" -Recurse