devops: fix publishing @next versions (#9963)
This patch: - removes the "is this upstream check?" when publishing daily version - fixes the bug when manually triggered builds were pushed under @beta tag Drive-by: rename "tip-of-tree" flag to "next" for consistency.
This commit is contained in:
parent
3d775f34af
commit
e26a722d23
15
.github/workflows/publish_canary_npm.yml
vendored
15
.github/workflows/publish_canary_npm.yml
vendored
|
|
@ -23,15 +23,22 @@ jobs:
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
- run: npx playwright install-deps
|
- run: npx playwright install-deps
|
||||||
- name: Publish to NPM (@next)
|
- name: "@next: publish with commit timestamp (triggered manually)"
|
||||||
|
if: contains(github.ref, 'master') && github.event_name == 'workflow_dispatch'
|
||||||
|
run: |
|
||||||
|
node utils/build/update_canary_version.js --today-date
|
||||||
|
utils/publish_all_packages.sh --next
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
- name: "@next: publish with today's date (triggered automatically)"
|
||||||
if: contains(github.ref, 'master') && github.event_name != 'workflow_dispatch'
|
if: contains(github.ref, 'master') && github.event_name != 'workflow_dispatch'
|
||||||
run: |
|
run: |
|
||||||
node utils/build/update_canary_version.js --today-date
|
node utils/build/update_canary_version.js --today-date
|
||||||
utils/publish_all_packages.sh --tip-of-tree
|
utils/publish_all_packages.sh --next
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
- name: Publish to NPM (@beta)
|
- name: "@beta: publish with commit timestamp (triggered automatically)"
|
||||||
if: contains(github.ref, 'release') || github.event_name == 'workflow_dispatch'
|
if: contains(github.ref, 'release') && github.event_name != 'workflow_dispatch'
|
||||||
run: |
|
run: |
|
||||||
node utils/build/update_canary_version.js --commit-timestamp
|
node utils/build/update_canary_version.js --commit-timestamp
|
||||||
utils/publish_all_packages.sh --beta
|
utils/publish_all_packages.sh --beta
|
||||||
|
|
|
||||||
|
|
@ -15,18 +15,18 @@ trap "cleanup; cd $(pwd -P)" EXIT
|
||||||
cd "$(dirname $0)"
|
cd "$(dirname $0)"
|
||||||
|
|
||||||
if [[ $1 == "--help" ]]; then
|
if [[ $1 == "--help" ]]; then
|
||||||
echo "usage: $(basename $0) [--release|--tip-of-tree]"
|
echo "usage: $(basename $0) [--release|--next|--beta]"
|
||||||
echo
|
echo
|
||||||
echo "Publishes all packages."
|
echo "Publishes all packages."
|
||||||
echo
|
echo
|
||||||
echo "--release publish @latest version of all packages"
|
echo "--release publish @latest version of all packages"
|
||||||
echo "--tip-of-tree publish @next version of all packages"
|
echo "--next publish @next version of all packages"
|
||||||
echo "--beta publish @beta version of all packages"
|
echo "--beta publish @beta version of all packages"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $# < 1 ]]; then
|
if [[ $# < 1 ]]; then
|
||||||
echo "Please specify either --release or --tip-of-tree"
|
echo "Please specify either --release, --beta or --next"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -57,20 +57,13 @@ if [[ $1 == "--release" ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
NPM_PUBLISH_TAG="latest"
|
NPM_PUBLISH_TAG="latest"
|
||||||
elif [[ $1 == "--tip-of-tree" ]]; then
|
elif [[ $1 == "--next" ]]; then
|
||||||
# Ensure package version contains dash.
|
# Ensure package version contains dash.
|
||||||
if [[ "${VERSION}" != *-* ]]; then
|
if [[ "${VERSION}" != *-* ]]; then
|
||||||
echo "ERROR: cannot publish release version with --tip-of-tree flag"
|
echo "ERROR: cannot publish release version with --next flag"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Ensure this is actually tip-of-tree.
|
|
||||||
UPSTREAM_SHA=$(git ls-remote https://github.com/microsoft/playwright --tags $(git rev-parse --abbrev-ref HEAD) | cut -f1)
|
|
||||||
CURRENT_SHA=$(git rev-parse HEAD)
|
|
||||||
if [[ "${UPSTREAM_SHA}" != "${CURRENT_SHA}" ]]; then
|
|
||||||
echo "FYI: REFUSING TO PUBLISH since this is not tip-of-tree"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
NPM_PUBLISH_TAG="next"
|
NPM_PUBLISH_TAG="next"
|
||||||
elif [[ $1 == "--beta" ]]; then
|
elif [[ $1 == "--beta" ]]; then
|
||||||
# Ensure package version contains dash.
|
# Ensure package version contains dash.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue