Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Park <gimli01@github.com>2021-05-28 00:33:42 +0300
committerGar <gar+gh@danger.computer>2021-05-28 17:07:37 +0300
commit685f4bee08772eb51d7c74d1bbf824f9fc207adf (patch)
tree37338f41d4a7b35fcd28637b34a2d0cb5f569732 /.github
parent97a898dd2c0b41cd75fc5d175a176e59a8f5480f (diff)
chore(ci): Move logic in update-npm.sh into GA workflow
PR-URL: https://github.com/npm/cli/pull/3324 Credit: @gimli01 Close: #3324 Reviewed-by: @wraithgar
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/create-cli-deps-pr.yml36
1 files changed, 33 insertions, 3 deletions
diff --git a/.github/workflows/create-cli-deps-pr.yml b/.github/workflows/create-cli-deps-pr.yml
index ec5397aa8..b7b102413 100644
--- a/.github/workflows/create-cli-deps-pr.yml
+++ b/.github/workflows/create-cli-deps-pr.yml
@@ -14,6 +14,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.NPM_ROBOT_USER_PAT }}
NPM_VERSION: ${{ github.event.inputs.npmVersion }}
+ SUPPORT_BRANCH: "v14.x-staging"
steps:
- name: Checkout npm/node
uses: actions/checkout@v2
@@ -25,18 +26,47 @@ jobs:
- name: Run dependency updates and create PR
run: |
npm_tag=""
+ base_branch=""
if [ "$NPM_VERSION" == "latest" ]
then
npm_tag=`npm view npm@latest version`
+ base_branch="master"
else
npm_tag="$NPM_VERSION"
+ base_branch="v14.x-staging"
fi
git config user.name "npm-robot"
git config user.email "ops+robot@npmjs.com"
git checkout -b "npm-$npm_tag"
- ./tools/update-npm.sh "$npm_tag"
+
+ BASE_DIR="$( pwd )"/
+ DEPS_DIR="$BASE_DIR"deps/
+
+ echo "Cloning CLI repo"
+ gh repo clone npm/cli
+
+ echo "Prepping CLI repo for release"
+ cd cli
+ git checkout v"$npm_tag"
+ make
+ make release
+
+
+ echo "Removing old npm"
+ cd "$DEPS_DIR"
+ rm -rf npm/
+
+ echo "Copying new npm"
+ tar zxf "$BASE_DIR"cli/release/npm-"$npm_tag".tgz
+
+ echo "Removing CLI workspace"
+ cd "$BASE_DIR"
+ rm -rf cli
+
+ git add -A deps/npm
+ git commit -m "deps: upgrade npm to $npm_tag"
+ git rebase --whitespace=fix HEAD^
git push origin "npm-$npm_tag"
gh_release_body=`gh release view v"$npm_tag" -R npm/cli`
- echo $gh_release_body
- gh pr create -R "npm/node" -B "$base_branch" -H "npm:$release_branch_name" --title "deps(cli): upgrade npm to $npm_version" --body "$gh_release_body"
+ gh pr create -R "nodejs/node" -B "$base_branch" -H "npm:npm-$npm_tag" --title "deps(cli): upgrade npm to $npm_tag" --body "$gh_release_body"