cloudflare/kumo

Public

mirrored from https://github.com/cloudflare/kumoAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
main

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

ci/versioning/publish-beta.sh

64lines · modecode

1#!/bin/bash
2set -euo pipefail
3
4# Beta release script for CI
5# Versions, builds, publishes, and outputs report artifact
6
7echo "Starting beta release process..."
8
9# Configure npm registry authentication
10cat > ~/.npmrc << EOF
11@cloudflare:registry=https://registry.npmjs.org
12//registry.npmjs.org/:_authToken=${NPM_TOKEN}
13EOF
14
15# Configure git for commits
16git config --global user.email "github-actions[bot]@users.noreply.github.com"
17git config --global user.name "GitHub Actions"
18
19# Run the versioning step first
20echo "Versioning packages..."
21pnpm run version:beta
22
23# Build the package before publishing
24echo "Building package..."
25cd packages/kumo && pnpm run build && cd ../..
26
27# Run the publish step after versioning and building
28echo "Publishing to npm..."
29pnpm run release:beta
30
31# Get the published version
32NEW_VERSION=$(node -p "require('./packages/kumo/package.json').version")
33PACKAGE_NAME="${PACKAGE_NAME:-@cloudflare/kumo}"
34
35echo "Published version: $NEW_VERSION"
36
37# Verify the version was published successfully
38echo "Verifying publication..."
39sleep 45
40
41AVAILABLE_VERSIONS=$(pnpm view ${PACKAGE_NAME} versions --json 2>/dev/null || echo '[]')
42echo "Checking for version: $NEW_VERSION"
43
44if echo "$AVAILABLE_VERSIONS" | grep -F "\"$NEW_VERSION\"" > /dev/null; then
45 echo "Version $NEW_VERSION successfully published and verified in npm registry"
46elif pnpm view ${PACKAGE_NAME}@${NEW_VERSION} version > /dev/null 2>&1; then
47 echo "Version $NEW_VERSION successfully published and verified via direct lookup"
48else
49 echo "Version $NEW_VERSION not found in npm registry after publishing"
50 echo "Searched for: $NEW_VERSION"
51 echo "Last 10 available versions:"
52 echo "$AVAILABLE_VERSIONS" | grep -o '"[^"]*"' | tail -10
53 echo ""
54 echo "Note: The version might exist but verification failed due to registry propagation delay"
55 echo "Manual verification: pnpm view ${PACKAGE_NAME}@${NEW_VERSION}"
56 exit 1
57fi
58
59# Output report artifact for the PR reporter job
60echo "Writing report artifact..."
61export PACKAGE_VERSION="$NEW_VERSION"
62pnpm tsx ci/scripts/write-npm-report.ts
63
64echo "Beta release complete!"
65