Skip to content
Closed
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
48 changes: 38 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,18 @@ jobs:
# release tag like v1.0.0 for a package whose version string
# happens to contain "alpha"/"beta" as a substring isn't
# mis-tagged on npm.
if [[ "${VERSION}" == *-alpha* ]]; then
npm publish --access public --tag alpha
elif [[ "${VERSION}" == *-beta* ]]; then
npm publish --access public --tag beta
# Any SemVer prerelease (identifier after the first "-") publishes
# under its own dist-tag, never "latest": alpha/beta/rc/next/... A
# tag like v1.1.0-rc.1 previously fell through to a bare publish and
# would have moved "latest" to a prerelease.
PRERELEASE="${VERSION#*-}"
if [[ "${PRERELEASE}" != "${VERSION}" ]]; then
DIST_TAG="${PRERELEASE%%.*}" # 1.0.0-rc.1 -> rc
DIST_TAG="${DIST_TAG%%+*}" # strip build metadata
DIST_TAG="$(printf '%s' "${DIST_TAG}" | tr -cd '[:alnum:]-')"
[[ -z "${DIST_TAG}" ]] && DIST_TAG="prerelease"
echo "Publishing prerelease ${VERSION} with --tag ${DIST_TAG}"
npm publish --access public --tag "${DIST_TAG}"
else
PKG_NAME=$(node -p "require('./package.json').name")
PKG_VERSION=$(node -p "require('./package.json').version")
Expand Down Expand Up @@ -288,8 +296,20 @@ jobs:
try {
execFileSync(binPath, process.argv.slice(2), { stdio: "inherit" });
} catch (e) {
if (e && typeof e === "object" && "status" in e) {
process.exit(e.status);
if (e && typeof e === "object") {
// Normal non-zero exit: pass the code through.
if (typeof e.status === "number") {
process.exit(e.status);
}
// Signal death (SIGTERM/SIGSEGV/...): execFileSync reports
// status: null + signal. Exiting with e.status here becomes
// process.exit(null) -> 0, turning a killed process into
// "success" for any caller checking $?. Use the shell
// convention 128+signal instead (SIGTERM -> 143).
if (e.signal) {
const signum = (os.constants && os.constants.signals && os.constants.signals[e.signal]) || 0;
process.exit(signum ? 128 + signum : 1);
}
}
throw e;
}
Expand All @@ -300,10 +320,18 @@ jobs:
# release tag like v1.0.0 for a package whose version string
# happens to contain "alpha"/"beta" as a substring isn't
# mis-tagged on npm.
if [[ "${VERSION}" == *-alpha* ]]; then
npm publish --access public --tag alpha
elif [[ "${VERSION}" == *-beta* ]]; then
npm publish --access public --tag beta
# Any SemVer prerelease (identifier after the first "-") publishes
# under its own dist-tag, never "latest": alpha/beta/rc/next/... A
# tag like v1.1.0-rc.1 previously fell through to a bare publish and
# would have moved "latest" to a prerelease.
PRERELEASE="${VERSION#*-}"
if [[ "${PRERELEASE}" != "${VERSION}" ]]; then
DIST_TAG="${PRERELEASE%%.*}" # 1.0.0-rc.1 -> rc
DIST_TAG="${DIST_TAG%%+*}" # strip build metadata
DIST_TAG="$(printf '%s' "${DIST_TAG}" | tr -cd '[:alnum:]-')"
[[ -z "${DIST_TAG}" ]] && DIST_TAG="prerelease"
echo "Publishing prerelease ${VERSION} with --tag ${DIST_TAG}"
npm publish --access public --tag "${DIST_TAG}"
else
PKG_NAME=$(node -p "require('./package.json').name")
PKG_VERSION=$(node -p "require('./package.json').version")
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "agentmail-cli"
version = "1.0.0"
version = "1.0.1"
edition = "2021"
description = "Command-line interface for the AgentMail API. Send, receive, reply, and manage threaded email conversations from your terminal."
license = "MIT"
Expand Down
Loading