Skip to content

Commit ca55142

Browse files
authored
Merge pull request #42 from Expensify/Rory-VersionBumpChanges
Bump version to 0.71.2-alpha.0
2 parents 5a56653 + 48c12a6 commit ca55142

File tree

9 files changed

+43
-10
lines changed

9 files changed

+43
-10
lines changed

Libraries/Core/ReactNativeVersion.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ exports.version = {
1313
major: 0,
1414
minor: 71,
1515
patch: 2,
16-
prerelease: null,
16+
prerelease: 'alpha.0',
1717
};

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
# Expensify Release
22

3-
To publish a new version run the following script, where `<base-version>` is the react-native version that the fork is based on, and `<fork-version>` is the version you want to publish. This will generate a tarball (`react-native-<fork-version>.tgz`) which can then be uploaded to a github release and consumed via npm.
3+
## Versioning
4+
5+
Before publishing an Expensify Release of this fork, you must first set the correct package version. The version should mirror the upstream tag that it's based off.
6+
7+
For example:
8+
9+
- While writing this, the upstream tag I've based this version of the fork off is `0.71.2`. Since this is our first time publishing the fork under this upstream version, the correct version for the fork is `0.71.2-alpha.0` (and the corresponding git branch should be called `Expensify-0.71.2-alpha.0`)
10+
- If we publish the fork again without upgrading the fork to be based off a new upstream tag (such as `0.71.3`), then the next version would be `0.71.2-alpha.1`
11+
- If we publish the fork again with a new upstream tag (such as `0.71.4`), then the alpha should reset, and the correct version would then be `0.71.4-alpha.0`
12+
13+
To update the version on the fork, run the following script:
14+
15+
```bash
16+
node ./scripts/set-rn-version.js --to-version <fork-version> --build-type expensify
17+
```
18+
19+
Then commit your changes.
20+
21+
## Publishing
22+
23+
To _publish_ a new version run the following script, where `<base-version>` is the react-native version that the fork is based on, and `<fork-version>` is the version you want to publish. This will generate a tarball (`react-native-<fork-version>.tgz`) which can then be uploaded to a github release and consumed via npm.
424

525
```bash
626
node ./scripts/publish-npm-expensify.js --base-version <base-version> --fork-version <fork-version>

React/Base/RCTVersion.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
RCTVersionMajor: @(0),
2525
RCTVersionMinor: @(71),
2626
RCTVersionPatch: @(2),
27-
RCTVersionPrerelease: [NSNull null],
27+
RCTVersionPrerelease: @"alpha.0",
2828
};
2929
});
3030
return __rnVersion;

ReactAndroid/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION_NAME=0.71.2
1+
VERSION_NAME=0.71.2-alpha.0
22
GROUP=com.facebook.react
33

44
# JVM Versions

ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ public class ReactNativeVersion {
1818
"major", 0,
1919
"minor", 71,
2020
"patch", 2,
21-
"prerelease", null);
21+
"prerelease", "alpha.0");
2222
}

ReactCommon/cxxreact/ReactNativeVersion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ constexpr struct {
1818
int32_t Major = 0;
1919
int32_t Minor = 71;
2020
int32_t Patch = 2;
21-
std::string_view Prerelease = "";
21+
std::string_view Prerelease = "alpha.0";
2222
} ReactNativeVersion;
2323

2424
} // namespace facebook::react

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@expensify/react-native",
3-
"version": "0.71.2",
3+
"version": "0.71.2-alpha.0",
44
"bin": "./cli.js",
55
"description": "A framework for building native apps using React",
66
"license": "MIT",
@@ -208,4 +208,4 @@
208208
}
209209
]
210210
}
211-
}
211+
}

scripts/version-utils.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ function parseVersion(versionStr, buildType) {
6666
}
6767

6868
function validateBuildType(buildType) {
69-
const validBuildTypes = new Set(['release', 'dry-run', 'nightly']);
69+
const validBuildTypes = new Set([
70+
'release',
71+
'dry-run',
72+
'nightly',
73+
'expensify',
74+
]);
7075
if (!validBuildTypes.has(buildType)) {
7176
throw new Error(`Unsupported build type: ${buildType}`);
7277
}
@@ -87,6 +92,7 @@ function validateVersion(versionObject, buildType) {
8792
release: validateRelease,
8893
'dry-run': validateDryRun,
8994
nightly: validateNightly,
95+
expensify: validateExpensify,
9096
};
9197

9298
const validationFunction = map[buildType];
@@ -125,6 +131,13 @@ function validateNightly(version) {
125131
}
126132
}
127133

134+
function validateExpensify(version) {
135+
const isValidExpensify = version.prerelease && version.prerelease.match(/alpha\.\d/);
136+
if (!isValidExpensify) {
137+
throw new Error(`Version ${version.version} is not valid for Expensify`);
138+
}
139+
}
140+
128141
function isStableRelease(version) {
129142
return (
130143
version.major === '0' && version.minor !== '0' && version.prerelease == null

template/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"dependencies": {
1313
"react": "18.2.0",
14-
"react-native": "0.71.2"
14+
"react-native": "0.71.2-alpha.0"
1515
},
1616
"devDependencies": {
1717
"@babel/core": "^7.20.0",

0 commit comments

Comments
 (0)