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

tools: add automation for updating postject dependency #46157

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/tools.yml
Expand Up @@ -77,6 +77,16 @@ jobs:
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
./tools/update-undici.sh
fi
- id: postject
subsystem: deps
label: dependencies
run: |
NEW_VERSION=$(npm view postject dist-tags.latest)
CURRENT_VERSION=$(node -p "require('./test/fixtures/postject-copy/node_modules/postject/package.json').version")
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
./tools/update-postject.sh
RaisinTen marked this conversation as resolved.
Show resolved Hide resolved
fi
RaisinTen marked this conversation as resolved.
Show resolved Hide resolved
- id: base64
subsystem: deps
label: dependencies
Expand Down
23 changes: 23 additions & 0 deletions doc/contributing/maintaining-postject.md
@@ -0,0 +1,23 @@
# Maintaining postject

The [postject](https://github.com/nodejs/postject) dependency is used for the
[Single Executable strategic initiative](https://github.com/nodejs/single-executable).

## Updating postject

The `tools/update-postject.sh` script automates the update of the postject
source files.

Check that Node.js still builds and tests.

## Committing postject

Add postject: `git add --all test/fixtures/postject-copy`

Commit the changes with a message like
RaisinTen marked this conversation as resolved.
Show resolved Hide resolved

```text
deps: update postject to 1.0.0-alpha.4

Updated as described in doc/contributing/maintaining-postject.md.
```
23 changes: 23 additions & 0 deletions tools/update-postject.sh
@@ -0,0 +1,23 @@
#!/bin/sh

# Shell script to update postject 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.

set -ex

cd "$( dirname "$0" )/.." || exit
rm -rf test/fixtures/postject-copy

mkdir test/fixtures/postject-copy
cd test/fixtures/postject-copy || exit

ROOT="$PWD/../../.."
[ -z "$NODE" ] && NODE="$ROOT/out/Release/node"
[ -x "$NODE" ] || NODE=$(command -v node)
NPM="$ROOT/deps/npm/bin/npm-cli.js"

"$NODE" "$NPM" init --yes

"$NODE" "$NPM" install --no-bin-links --ignore-scripts postject