Skip to content
Closed
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
Prev Previous commit
Next Next commit
tools: migrate update-minimatch to update-picomatch
  • Loading branch information
danielbayley committed Jun 23, 2024
commit 815827faf8e765999ff87486f0ed362768398068
18 changes: 9 additions & 9 deletions .github/workflows/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ on:
# - libuv
- lint-md-dependencies
- llhttp
- minimatch
- nghttp2
- nghttp3
- ngtcp2
- picomatch
- postject
- root-certificates
- simdjson
Expand Down Expand Up @@ -212,14 +212,6 @@ jobs:
cat temp-output
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
rm temp-output
- id: minimatch
subsystem: deps
label: dependencies
run: |
./tools/dep_updaters/update-minimatch.sh > temp-output
cat temp-output
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
rm temp-output
- id: nghttp2
subsystem: deps
label: dependencies
Expand All @@ -244,6 +236,14 @@ jobs:
cat temp-output
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
rm temp-output
- id: picomatch
subsystem: deps
label: dependencies
run: |
./tools/dep_updaters/update-picomatch.sh > temp-output
cat temp-output
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
rm temp-output
- id: postject
subsystem: deps,test
label: test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

# Shell script to update minimatch in the source tree to the latest release.
# Shell script to update picomatch in the source tree to the latest release.

# This script must be in the tools directory when it runs because it uses the
# script source file path to determine directories to work in.
Expand All @@ -16,11 +16,11 @@ NPM="$DEPS_DIR/npm/bin/npm-cli.js"
# shellcheck disable=SC1091
. "$BASE_DIR/tools/dep_updaters/utils.sh"

NEW_VERSION=$("$NODE" "$NPM" view minimatch dist-tags.latest)
CURRENT_VERSION=$("$NODE" -p "require('./deps/minimatch/package.json').version")
NEW_VERSION=$("$NODE" "$NPM" view picomatch dist-tags.latest)
CURRENT_VERSION=$("$NODE" -p "require('./deps/picomatch/package.json').version")

# This function exit with 0 if new version and current version are the same
compare_dependency_version "minimatch" "$NEW_VERSION" "$CURRENT_VERSION"
compare_dependency_version "picomatch" "$NEW_VERSION" "$CURRENT_VERSION"

cd "$( dirname "$0" )/../.." || exit

Expand All @@ -38,39 +38,29 @@ trap cleanup INT TERM EXIT

cd "$WORKSPACE"

echo "Fetching minimatch source archive..."
echo "Fetching picomatch source archive..."

"$NODE" "$NPM" pack "minimatch@$NEW_VERSION"
"$NODE" "$NPM" pack "picomatch@$NEW_VERSION"

MINIMATCH_TGZ="minimatch-$NEW_VERSION.tgz"
PICOMATCH_TGZ="picomatch-$NEW_VERSION.tgz"

log_and_verify_sha256sum "minimatch" "$MINIMATCH_TGZ"
log_and_verify_sha256sum "picomatch" "$PICOMATCH_TGZ"

rm -r "$DEPS_DIR/minimatch"/*
rm -rf "$DEPS_DIR/picomatch"

tar -xf "$MINIMATCH_TGZ"
tar -xf "$PICOMATCH_TGZ"

cd package

"$NODE" "$NPM" install esbuild --save-dev

"$NODE" "$NPM" pkg set scripts.node-build="esbuild ./dist/commonjs/index.js --bundle --platform=node --outfile=index.js"

"$NODE" "$NPM" run node-build

rm -rf node_modules

mv ./* "$DEPS_DIR/minimatch"
mv package "$DEPS_DIR/picomatch"

echo "All done!"
echo ""
echo "Please git add minimatch, commit the new version:"
echo "Please git add picomatch, commit the new version:"
echo ""
echo "$ git add -A deps/minimatch"
echo "$ git commit -m \"deps: update minimatch to $NEW_VERSION\""
echo "$ git add -A deps/picomatch"
echo "$ git commit -m \"deps: update picomatch to $NEW_VERSION\""
echo ""

# Update the version number on maintaining-dependencies.md
# and print the new version as the last line of the script as we need
# to add it to $GITHUB_ENV variable
finalize_version_update "minimatch" "$NEW_VERSION"
finalize_version_update "picomatch" "$NEW_VERSION"