mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-12-15 01:22:34 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
536b5487a2 | ||
|
|
cc1e5776b5 | ||
|
|
8ac7b83e5b | ||
|
|
6ab80be42f |
16
.github/workflows/publish.yml
vendored
16
.github/workflows/publish.yml
vendored
@@ -2,6 +2,11 @@ name: Publish Package to npmjs
|
|||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
id-token: write # Required for OIDC
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -9,14 +14,15 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
id-token: write
|
id-token: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: oven-sh/setup-bun@v2
|
- uses: oven-sh/setup-bun@v2
|
||||||
# Setup .npmrc file to publish to npm
|
# Setup .npmrc file to publish to npm
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '20.x'
|
node-version: 24
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
- run: bun install --frozen-lockfile
|
- run: bun install --frozen-lockfile
|
||||||
|
# Ensure npm 11.5.1 or later is installed
|
||||||
|
- name: Update npm
|
||||||
|
run: npm install -g npm@latest
|
||||||
- run: npm publish --provenance --access public
|
- run: npm publish --provenance --access public
|
||||||
env:
|
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
||||||
|
|||||||
@@ -77,41 +77,16 @@ RCT_EXPORT_MODULE(RCTPushy);
|
|||||||
NSString *storedPackageVersion = [defaults stringForKey:paramPackageVersion];
|
NSString *storedPackageVersion = [defaults stringForKey:paramPackageVersion];
|
||||||
NSString *storedBuildTime = [defaults stringForKey:paramBuildTime];
|
NSString *storedBuildTime = [defaults stringForKey:paramBuildTime];
|
||||||
|
|
||||||
RCTLogInfo(@"RCTPushy -- Version check: curPackageVersion=%@, curBuildTime=%@, storedPackageVersion=%@, storedBuildTime=%@",
|
BOOL packageVersionChanged = !storedPackageVersion || ![curPackageVersion isEqualToString:storedPackageVersion];
|
||||||
curPackageVersion ?: @"nil",
|
BOOL buildTimeChanged = !storedBuildTime || ![curBuildTime isEqualToString:storedBuildTime];
|
||||||
curBuildTime ?: @"nil",
|
|
||||||
storedPackageVersion ?: @"nil",
|
|
||||||
storedBuildTime ?: @"nil");
|
|
||||||
|
|
||||||
// If stored versions don't exist, write current versions first
|
|
||||||
if (!storedPackageVersion) {
|
|
||||||
RCTLogInfo(@"RCTPushy -- No stored package version found, writing current version: %@", curPackageVersion);
|
|
||||||
[defaults setObject:curPackageVersion forKey:paramPackageVersion];
|
|
||||||
storedPackageVersion = curPackageVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!storedBuildTime) {
|
|
||||||
RCTLogInfo(@"RCTPushy -- No stored build time found, writing current build time: %@", curBuildTime);
|
|
||||||
[defaults setObject:curBuildTime forKey:paramBuildTime];
|
|
||||||
storedBuildTime = curBuildTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL packageVersionChanged = ![curPackageVersion isEqualToString:storedPackageVersion];
|
|
||||||
BOOL buildTimeChanged = curBuildTime && ![curBuildTime isEqualToString:storedBuildTime];
|
|
||||||
|
|
||||||
RCTLogInfo(@"RCTPushy -- Version change check: packageVersionChanged=%d, buildTimeChanged=%d",
|
|
||||||
packageVersionChanged, buildTimeChanged);
|
|
||||||
|
|
||||||
if (packageVersionChanged || buildTimeChanged) {
|
if (packageVersionChanged || buildTimeChanged) {
|
||||||
RCTLogInfo(@"RCTPushy -- Version or build time changed, clearing update data. packageVersionChanged=%d, buildTimeChanged=%d",
|
|
||||||
packageVersionChanged, buildTimeChanged);
|
|
||||||
// Clear all update data and store new versions
|
// Clear all update data and store new versions
|
||||||
[defaults setObject:nil forKey:keyPushyInfo];
|
[defaults setObject:nil forKey:keyPushyInfo];
|
||||||
[defaults setObject:nil forKey:keyHashInfo];
|
[defaults setObject:nil forKey:keyHashInfo];
|
||||||
[defaults setObject:@(YES) forKey:KeyPackageUpdatedMarked];
|
[defaults setObject:@(YES) forKey:KeyPackageUpdatedMarked];
|
||||||
[defaults setObject:curPackageVersion forKey:paramPackageVersion];
|
[defaults setObject:curPackageVersion forKey:paramPackageVersion];
|
||||||
[defaults setObject:curBuildTime forKey:paramBuildTime];
|
[defaults setObject:curBuildTime forKey:paramBuildTime];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NSDictionary *pushyInfo = [defaults dictionaryForKey:keyPushyInfo];
|
NSDictionary *pushyInfo = [defaults dictionaryForKey:keyPushyInfo];
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-native-update",
|
"name": "react-native-update",
|
||||||
"version": "10.36.4",
|
"version": "10.36.5",
|
||||||
"description": "react-native hot update",
|
"description": "react-native hot update",
|
||||||
"main": "src/index",
|
"main": "src/index",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user