Skip to content
Merged
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
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ jobs:
tar -xzf native-ios.tgz
corepack yarn typecheck
corepack yarn prepare
npm pack --ignore-scripts --json > pack.json
python3 scripts/verify-release.py "$(node -p "require('./pack.json')[0].filename")" "$GITHUB_REF_NAME"
npm pack --ignore-scripts
RN_TARBALL="loro-react-native-$(node -p "require('./package.json').version").tgz"
python3 scripts/verify-release.py "$RN_TARBALL" "$GITHUB_REF_NAME"
- uses: actions/upload-artifact@v4
with:
name: npm-package
Expand All @@ -85,4 +86,5 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm install --global npm@11
npm publish "$(node -p "require('./pack.json')[0].filename")" --access public --provenance
RN_TARBALL="loro-react-native-$(node -p "require('./package.json').version").tgz"
npm publish "$RN_TARBALL" --access public --provenance
4 changes: 3 additions & 1 deletion scripts/verify-release.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import json
from pathlib import Path
import re
import sys
import tarfile
import tomllib
Expand All @@ -13,7 +14,8 @@ def main():
with tarfile.open(tarball, "r:gz") as archive:
names = set(archive.getnames())
package = json.load(archive.extractfile("package/package.json"))
assert tag == "v" + package["version"], "tag and package version differ"
expected_tag = re.escape("v" + package["version"]) + r"(?:-build\.\d+)?"
assert re.fullmatch(expected_tag, tag), "tag and package version differ"
required = {
"package/build/LoroFfiFramework.xcframework/Info.plist",
"package/android/src/main/jniLibs/arm64-v8a/libloro_rs.a",
Expand Down
Loading