Skip to content

Commit

Permalink
chore: update package.json so it tracks new optional packages
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Jul 15, 2024
1 parent 80b66a8 commit 3ac23c7
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 104 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ all:
(cd $$node_pkg && npm publish --access public --dry-run;)\
done

export node_os?=
vers:
@for supported_platform in $(supported_platforms); do \
IFS='-' read -r node_os node_arch <<< "$$supported_platform"; \
export node_os=$$node_os; \
export node_arch=$$node_arch; \
export node_pkg=$(bin)-$$node_os-$$node_arch; \
jq '.optionalDependencies."'$$node_pkg'" = "$(pkg_version)"' package.json > package-new.json; \
mv package-new.json package.json; \
done

dry_run:
set -eu; for supported_platform in $(supported_platforms); do \
IFS='-' read -r node_os node_arch <<< "$$supported_platform"; \
Expand Down
104 changes: 7 additions & 97 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
"access": "public"
},
"optionalDependencies": {
"@pact-foundation/pact-core-darwin-arm64": "0.0.1",
"@pact-foundation/pact-core-darwin-x64": "0.0.1",
"@pact-foundation/pact-core-windows-x64": "0.0.1",
"@pact-foundation/pact-core-linux-x64": "0.0.1",
"@pact-foundation/pact-core-linux-arm64": "0.0.1"
"@pact-foundation/pact-core-darwin-arm64": "15.1.0",
"@pact-foundation/pact-core-darwin-x64": "15.1.0",
"@pact-foundation/pact-core-windows-x64": "15.1.0",
"@pact-foundation/pact-core-linux-x64": "15.1.0",
"@pact-foundation/pact-core-linux-arm64": "15.1.0"
},
"dependencies": {
"check-types": "7.3.0",
Expand Down
3 changes: 2 additions & 1 deletion script/ci/build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ node --version
npm --version

npm ci --ignore-scripts

make link
make vers
npm run format:check
npm run lint
npm run build
Expand Down
2 changes: 2 additions & 0 deletions script/ci/lib/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ echo " Publishing pact-core@${VERSION}..."
if [[ ${DRY_RUN:-} == 'true' ]]; then
echo "publishing in dry run mode"
make dry_run
make vers
npm publish --access-public --dry-run
else
echo "--> Preparing npmrc file"
"$SCRIPT_DIR"/create_npmrc_file.sh
echo "--> Removing binding.gyp to prevent rebuild. See https://github.com/npm/cli/issues/5234#issuecomment-1291139150"
rm "${SCRIPT_DIR}/../../../binding.gyp"
make publish
make vers
npm publish --access public --tag latest
fi
echo " done!"
1 change: 0 additions & 1 deletion script/ci/unpack-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ mkdir -p prebuilds
mv artifact*/*.tar.gz . || echo "no mac prebuilds"
ls *.gz |xargs -n1 tar -xzf
make all
make link
"$SCRIPT_DIR"/../download-plugins.sh
"$SCRIPT_DIR"/build-and-test.sh

0 comments on commit 3ac23c7

Please sign in to comment.