Skip to content

Commit

Permalink
Package-lock deploy script (#2068)
Browse files Browse the repository at this point in the history
* Update dependencies in package-lock

https://eaflood.atlassian.net/browse/IWTF-4117

update deploy script to update package-lock files

* add line to update package lock by running npm install

* update package-lock to match package.json so can grab correct version in deploy action

* move so packages are deployed to npm so can access

* add a delay to allow npm to register version

* keep consitent bottom of file for packages
  • Loading branch information
ScottDormand96 authored Oct 29, 2024
1 parent 9d4a01d commit 0f9c828
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/connectors-lib/package-lock.json

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

2 changes: 1 addition & 1 deletion packages/dynamics-lib/package-lock.json

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

2 changes: 1 addition & 1 deletion packages/fulfilment-job/package-lock.json

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

2 changes: 1 addition & 1 deletion packages/gafl-webapp-service/package-lock.json

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

2 changes: 1 addition & 1 deletion packages/payment-mop-up-job/package-lock.json

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

2 changes: 1 addition & 1 deletion packages/pocl-job/package-lock.json

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

2 changes: 1 addition & 1 deletion packages/recurring-payments-job/package-lock.json

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

2 changes: 1 addition & 1 deletion packages/sales-api-service/package-lock.json

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

2 changes: 1 addition & 1 deletion packages/sqs-receiver-service/package-lock.json

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

13 changes: 8 additions & 5 deletions scripts/github/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ echo "Updating version from ${PREVIOUS_VERSION} to ${NEW_VERSION}"
# Update package files versions, project inter-dependencies and lerna.json with new version number
lerna version "${NEW_VERSION}" --yes --no-push --force-publish --exact

echo "Updating package-lock.json from ${PREVIOUS_VERSION} to ${NEW_VERSION}"
# Update package-lock.json files to reflect new versions
lerna exec -- npm install --package-lock-only


# Generate changelog information for changes since the last tag
echo "Generating changelog updates for all changes between ${PREVIOUS_VERSION} and ${NEW_VERSION}"
lerna-changelog --from "${PREVIOUS_VERSION}" --to "${NEW_VERSION}" | cat - CHANGELOG.md > CHANGELOG.new && mv CHANGELOG.new CHANGELOG.md
Expand All @@ -89,6 +84,14 @@ git push origin "${NEW_VERSION}"
echo "Publishing latest packages to npm"
lerna publish --registry=https://registry.npmjs.org/ from-git --yes --pre-dist-tag rc --no-verify-access

# Add a delay to allow NPM registry to propagate the new versions
echo "Waiting for NPM registry to propagate new versions"
sleep 30

echo "Updating package-lock.json from ${PREVIOUS_VERSION} to ${NEW_VERSION}"
# Update package-lock.json files to reflect new versions
lerna exec -- npm install --package-lock-only

# If we've pushed a new release into master and it is not a hotfix/patch, then merge the changes back to develop
if [ "${BRANCH}" == "master" ] && [ "${RELEASE_TYPE}" != "patch" ]; then
git checkout develop
Expand Down

0 comments on commit 0f9c828

Please sign in to comment.