Skip to content

Commit 08a8ddf

Browse files
committed
fix
1 parent 8e2ccd1 commit 08a8ddf

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/publish-to.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
# Validate that version number is same across all expected files
3+
4+
set -exuo pipefail
5+
6+
version="${1%%+*}"
7+
tag="${2}"
8+
9+
cd lib
10+
file=src/version.ts
11+
if ! sed "s/export const version = \'[^']\{1,\}\';\$/export const version = \'${version}\';/" "${file}" >"${file}.tmp"; then
12+
echo "Failed to insert version [${version}] into file [$file]"
13+
exit 1
14+
fi
15+
mv "${file}.tmp" "${file}"
16+
17+
npm version --no-git-tag-version --allow-same-version "$version"
18+
npm publish --access public --tag "$tag"
19+
20+
# Wait for npm publish to go through...
21+
sleep 5
22+
23+
cd "../cli"
24+
npm version --no-git-tag-version --allow-same-version "$version"
25+
npm uninstall "@opentdf/sdk"
26+
npm install "@opentdf/sdk@$version"
27+
npm publish --access public --tag "$tag"
28+
29+
if [[ "$GITHUB_STEP_SUMMARY" ]]; then
30+
echo "### Published ${version} (${tag})" >>"$GITHUB_STEP_SUMMARY"
31+
fi

0 commit comments

Comments
 (0)