cloudflare/cloudflare-typescript

Public

mirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v4.2.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

bin/publish-npm

25lines · modecode

1#!/usr/bin/env bash
2
3set -eux
4
5npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN"
6
7# Build the project
8yarn build
9
10# Navigate to the dist directory
11cd dist
12
13# Get the version from package.json
14VERSION="$(node -p "require('./package.json').version")"
15
16# Extract the pre-release tag if it exists
17if [[ "$VERSION" =~ -([a-zA-Z]+) ]]; then
18 # Extract the part before any dot in the pre-release identifier
19 TAG="${BASH_REMATCH[1]}"
20else
21 TAG="latest"
22fi
23
24# Publish with the appropriate tag
25yarn publish --access public --tag "$TAG"
26