Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 19 additions & 1 deletion .github/workflows/callable-npm-publish-lts-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,23 @@ jobs:
github_user: ${{ vars.GH_USER}}
github_email: ${{ vars.GH_EMAIL}}

- name: Promote amazon-cognito-identity-js to the "latest" dist-tag

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we move this step after push or mark with continue-on-error ? If dist-tag fails the commit/tags never get pushed.

working-directory: ./amplify-js
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
# amazon-cognito-identity-js is the only unscoped package whose "latest"
# dist-tag must track the v5 line; the rest of the fleet rides "stable-5".
# This previously lived in the package's "postpublish" hook, where lerna
# ran it mid-parallel-publish, swallowed its output, and a single failure
# aborted the entire release. Running it here as an explicit, sequential
# step makes the result visible and retryable without re-publishing.
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
PKG=amazon-cognito-identity-js
VERSION=$(node -p "require('./packages/${PKG}/package.json').version")
echo "Setting ${PKG}@${VERSION} as latest"
npm dist-tag add "${PKG}@${VERSION}" latest

- name: Set github commit user
env:
GITHUB_EMAIL: ${{ vars.GH_EMAIL }}
Expand All @@ -51,4 +68,5 @@ jobs:
env:
TARGET_BRANCH: ${{ inputs.target }}
run: |
git push origin $TARGET_BRANCH
git pull --rebase origin "$TARGET_BRANCH"
git push origin "$TARGET_BRANCH"
3 changes: 1 addition & 2 deletions packages/amazon-cognito-identity-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
"generate-version": "genversion src/Platform/version.ts --es6 --semi",
"test": "jest --config ./jest.config.js",
"format": "echo \"Not implemented\"",
"ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json",
"postpublish": "npm dist-tag add $npm_package_name@$npm_package_version latest"
"ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json"
},
"main": "lib/index.js",
"react-native": {
Expand Down
Loading