Skip to content

Commit

Permalink
Final cleanup changes
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Feb 11, 2023
1 parent ca55142 commit 98bee83
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 21 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ GEM
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
zeitwerk (2.6.6)
zeitwerk (2.6.7)

PLATFORMS
ruby
Expand All @@ -97,4 +97,4 @@ RUBY VERSION
ruby 2.7.6p219

BUNDLED WITH
2.3.22
2.1.4
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,12 @@

## Versioning

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.

For example:
Before publishing an Expensify Release of this fork, you must first figure out the correct version. The version should mirror the upstream tag that it's based off.

- 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`)
- 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`
- 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`

To update the version on the fork, run the following script:

```bash
node ./scripts/set-rn-version.js --to-version <fork-version> --build-type expensify
```

Then commit your changes.

## Publishing
Expand Down
10 changes: 1 addition & 9 deletions scripts/version-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ function validateBuildType(buildType) {
'release',
'dry-run',
'nightly',
'expensify',
]);
if (!validBuildTypes.has(buildType)) {
throw new Error(`Unsupported build type: ${buildType}`);
Expand All @@ -92,7 +91,6 @@ function validateVersion(versionObject, buildType) {
release: validateRelease,
'dry-run': validateDryRun,
nightly: validateNightly,
expensify: validateExpensify,
};

const validationFunction = map[buildType];
Expand Down Expand Up @@ -131,13 +129,6 @@ function validateNightly(version) {
}
}

function validateExpensify(version) {
const isValidExpensify = version.prerelease && version.prerelease.match(/alpha\.\d/);
if (!isValidExpensify) {
throw new Error(`Version ${version.version} is not valid for Expensify`);
}
}

function isStableRelease(version) {
return (
version.major === '0' && version.minor !== '0' && version.prerelease == null
Expand All @@ -152,6 +143,7 @@ function isStablePrerelease(version) {
version.prerelease != null &&
(version.prerelease.startsWith('rc.') ||
version.prerelease.startsWith('rc-') ||
version.prerelease.startsWith('alpha.') ||
version.prerelease.match(/^(\d{8})-(\d{4})$/))
);
}
Expand Down
2 changes: 1 addition & 1 deletion sdks/hermes-engine/hermes-engine.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ build_type = :release

# package.json
package = JSON.parse(File.read(File.join(react_native_path, "package.json")))
version = package['version']
version = '0.71.2'

# sdks/.hermesversion
hermestag_file = File.join(react_native_path, "sdks", ".hermesversion")
Expand Down

0 comments on commit 98bee83

Please sign in to comment.