11name : Publish Package to npmjs
2+
23on :
3- release :
4- types : [published]
4+ push :
5+ branches :
6+ - automation/release-v2.22.4
7+ paths :
8+ - .github/workflows/publish.yml
59
610permissions :
7- id-token : write # Required for OIDC
8- contents : read
11+ id-token : write
12+ contents : write
913
1014jobs :
1115 build :
1418 steps :
1519 - uses : actions/checkout@v6
1620 with :
21+ ref : ef375f3a20b26634f45447e4d71ecb73efa00bb6
1722 fetch-depth : 0
1823
1924 - uses : oven-sh/setup-bun@v2
@@ -22,24 +27,18 @@ jobs:
2227
2328 - name : Prepare publish version
2429 env :
25- PUBLISH_VERSION : ${{ github.event.release.tag_name }}
30+ PUBLISH_VERSION : v2.22.4
2631 run : bun scripts/prepublish.ts
2732
28- - name : Verify package version matches release tag
29- env :
30- RELEASE_TAG : ${{ github.event.release.tag_name }}
33+ - name : Verify package version
3134 run : |
32- EXPECTED_VERSION="${RELEASE_TAG#v}"
3335 ACTUAL_VERSION="$(node -p "require('./package.json').version")"
34- echo "release tag: ${RELEASE_TAG} -> expected ${EXPECTED_VERSION} , package.json has ${ACTUAL_VERSION}"
35- test "${ACTUAL_VERSION}" = "${EXPECTED_VERSION} "
36+ echo "expected 2.22.4 , package.json has ${ACTUAL_VERSION}"
37+ test "${ACTUAL_VERSION}" = "2.22.4 "
3638
3739 - name : Build package
3840 run : bun run build
3941
40- # Node 18 must only be on PATH for the verification below, not during
41- # the build: typescript >= 7 ships an extensionless ESM bin/tsc that
42- # Node 18.17 cannot load (ERR_UNKNOWN_FILE_EXTENSION).
4342 - name : Set up Node.js 18 for runtime verification
4443 uses : actions/setup-node@v6
4544 with :
5049 node --version
5150 node lib/bin.js -v
5251 node lib/bin-cresc.js -v
53- # the programmatic entry points must also load on the minimum
54- # supported Node, not only the CLI banner
5552 node -e "const m = require('./lib/exports.js'); if (!m) process.exit(1)"
5653 node -e "const d = require('./lib/diff.js'); if (!d.diffCommands) process.exit(1)"
5754
@@ -64,11 +61,32 @@ jobs:
6461 - name : Verify publishable package contents
6562 run : npm pack --dry-run --ignore-scripts
6663
64+ - name : Check whether npm version already exists
65+ id : npm-version
66+ shell : bash
67+ run : |
68+ if npm view react-native-update-cli@2.22.4 version >/dev/null 2>&1; then
69+ echo "exists=true" >> "$GITHUB_OUTPUT"
70+ echo "react-native-update-cli@2.22.4 already exists; npm publish will be skipped"
71+ else
72+ echo "exists=false" >> "$GITHUB_OUTPUT"
73+ fi
74+
6775 - name : Publish to npm
76+ if : steps.npm-version.outputs.exists != 'true'
77+ run : npm publish --ignore-scripts --provenance --access public
78+
79+ - name : Create GitHub release
80+ env :
81+ GH_TOKEN : ${{ github.token }}
6882 shell : bash
6983 run : |
70- if [[ "${{ github.event.release.tag_name }}" == *"beta"* ]] ; then
71- npm publish --ignore-scripts --provenance --access public --tag beta
84+ if gh release view v2.22.4 --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1 ; then
85+ echo "GitHub release v2.22.4 already exists"
7286 else
73- npm publish --ignore-scripts --provenance --access public
87+ gh release create v2.22.4 \
88+ --repo "$GITHUB_REPOSITORY" \
89+ --target ef375f3a20b26634f45447e4d71ecb73efa00bb6 \
90+ --title "v2.22.4" \
91+ --notes "Fix Hermes base equivalence verification for UIntSwitchImm jump-table offsets. Tighten StringSwitchImm/UIntSwitchImm normalization so semantic operands remain checked, with regression coverage for IDs, labels, ranges, and malformed switch shapes."
7492 fi
0 commit comments