File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -58,14 +58,16 @@ runs:
58
58
# Input tag is SemVer compliant, use it directly
59
59
VERSION="$INPUT_TAG"
60
60
echo "Input tag '$INPUT_TAG' is valid SemVer. Using version '$VERSION'."
61
+ # Let npm publish determine the tag (latest or pre-release tag)
61
62
else
62
63
# Input tag is not SemVer, treat as branch/tag name
63
64
echo "Input tag '$INPUT_TAG' is not valid SemVer. Generating pre-release version."
64
65
# Sanitize the tag: replace non-alphanumeric/hyphen chars with hyphen
65
66
SANITIZED_TAG=$(echo "$INPUT_TAG" | sed 's/[^a-zA-Z0-9-]/-/g')
66
- # Construct the version string: major.minor.0-tag- pipeline
67
- VERSION="${MAJOR}.${MINOR}.0-${SANITIZED_TAG}- ${PIPELINE_ID}"
67
+ # Construct the version string: major.minor.0-tag. pipeline
68
+ VERSION="${MAJOR}.${MINOR}.0-${SANITIZED_TAG}. ${PIPELINE_ID}"
68
69
echo "Generated version: $VERSION"
70
+ # Publish with a tag derived from the sanitized input tag - npm handles this automatically now
69
71
fi
70
72
71
73
# Update package.json version
75
77
head package.json # Keep for debugging output
76
78
git config user.name "${GITHUB_ACTOR}"
77
79
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
80
+ echo "Publishing to NPM version '$VERSION'. Tag will be automatically determined by npm."
81
+ # Note: The space before $NPM_TAG_ARG is important if it's non-empty
82
+ # Npm automatically determines the tag (latest for standard, pre-id for pre-releases)
78
83
npm publish
79
84
shell : bash
80
85
env :
You can’t perform that action at this time.
0 commit comments