Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into fb62merge
Browse files Browse the repository at this point in the history
  • Loading branch information
rnbot committed May 8, 2020
2 parents b7f5188 + 61638a2 commit c57270f
Show file tree
Hide file tree
Showing 50 changed files with 948 additions and 939 deletions.
14 changes: 12 additions & 2 deletions .ado/android-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ name: $(Date:yyyyMMdd).$(Rev:.r)
trigger: none # will disable CI builds entirely

pr:
- master
- 0.59-stable
branches:
include:
- master
- 0.59-stable
paths:
exclude:
- '*.md'

jobs:
- job: AndroidRNPR
Expand Down Expand Up @@ -35,6 +40,11 @@ jobs:
inputs:
versionSpec: '>=4.6.4'

- task: CmdLine@2
displayName: "Rename package to react-native"
inputs:
script: node .ado/renamePackageForOffice.js

- task: CmdLine@2
displayName: npm install
inputs:
Expand Down
9 changes: 7 additions & 2 deletions .ado/apple-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ variables:
trigger: none # will disable CI builds entirely

pr:
- master
- 0.59-stable
branches:
include:
- master
- 0.59-stable
paths:
exclude:
- '*.md'

jobs:
- job: JavaScriptRNPR
Expand Down
2 changes: 1 addition & 1 deletion .ado/bumpFileVersions.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// @ts-check
const {updateVersionsInFiles} = require('./versionUtils');
updateVersionsInFiles();
updateVersionsInFiles('');
3 changes: 3 additions & 0 deletions .ado/bumpOfficeFileVersions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// @ts-check
const {updateVersionsInFiles} = require('./versionUtils');
updateVersionsInFiles('.0-microsoft');
49 changes: 49 additions & 0 deletions .ado/gitTagRelease.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// @ts-check
// Used to apply the package updates: the git tag for the published release.

const fs = require("fs");
const path = require("path");
const execSync = require("child_process").execSync;
const {pkgJsonPath, publishBranchName, gatherVersionInfo} = require('./versionUtils');

function exec(command) {
try {
console.log(`Running command: ${command}`);
return execSync(command, {
stdio: "inherit"
});
} catch (err) {
process.exitCode = 1;
console.log(`Failure running: ${command}`);
throw err;
}
}

function doPublish() {
console.log(`Target branch to publish to: ${publishBranchName}`);

const {releaseVersion, branchVersionSuffix} = gatherVersionInfo()

const tempPublishBranch = `publish-temp-${Date.now()}`;
exec(`git checkout -b ${tempPublishBranch}`);

exec(`git config --global user.email "53619745+rnbot@users.noreply.github.com"`);
exec(`git config --global user.name "React-Native Bot"`);

exec(`git add ${pkgJsonPath}`);
exec(`git commit -m "Applying package update to ${releaseVersion} ***NO_CI***"`);
exec(`git tag v${releaseVersion}`);
exec(`git push origin HEAD:${tempPublishBranch} --follow-tags --verbose`);
exec(`git push origin tag v${releaseVersion}`);

exec(`git checkout ${publishBranchName}`);
exec(`git pull origin ${publishBranchName}`);
exec(`git merge ${tempPublishBranch} --no-edit`);
exec(
`git push origin HEAD:${publishBranchName} --follow-tags --verbose`
);
exec(`git branch -d ${tempPublishBranch}`);
exec(`git push origin --delete -d ${tempPublishBranch}`);
}

doPublish();
46 changes: 46 additions & 0 deletions .ado/npmOfficePack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// @ts-check
// Create a tar asset for publishing to the Office feed

const fs = require("fs");
const path = require("path");
const execSync = require("child_process").execSync;
const {pkgJsonPath, publishBranchName, gatherVersionInfo} = require('./versionUtils');

function exec(command) {
try {
console.log(`Running command: ${command}`);
return execSync(command, {
stdio: "inherit"
});
} catch (err) {
process.exitCode = 1;
console.log(`Failure running: ${command}`);
throw err;
}
}

function doPublish() {
console.log(`Target branch to publish to: ${publishBranchName}`);

const {releaseVersion, branchVersionSuffix} = gatherVersionInfo()

const onlyTagSource = !!branchVersionSuffix;
if (!onlyTagSource) {
// -------- Generating Android Artifacts with JavaDoc
exec("gradlew installArchives");

// undo uncommenting javadoc setting
exec("git checkout ReactAndroid/gradle.properties");
}

// Create tar file
exec(`npm pack`);

const npmTarFileName = `react-native-${releaseVersion}.tgz`;
const npmTarPath = path.resolve(__dirname, '..', npmTarFileName);
const finalTarPath = path.join(process.env.BUILD_STAGINGDIRECTORY, 'final', npmTarFileName);
console.log(`Copying tar file ${npmTarPath} to: ${finalTarPath}`)
fs.copyFileSync(npmTarPath, finalTarPath);
}

doPublish();
155 changes: 0 additions & 155 deletions .ado/publish.js

This file was deleted.

27 changes: 19 additions & 8 deletions .ado/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,23 @@ jobs:
inputs:
script: node .ado/bumpFileVersions.js

- task: CmdLine@2
displayName: "Prepare package.json for npm publishing as react-native-macos"
inputs:
script: node .ado/renamePackageToMac.js

- task: Npm@1
displayName: "Publish react-native-macos to npmjs.org"
inputs:
command: 'publish'
publishEndpoint: 'npmjs'

- task: CmdLine@2
displayName: 'Tag published release'
inputs:
script: node .ado/gitTagRelease.js
env:
BUILD_STAGINGDIRECTORY: $(Build.StagingDirectory)
BUILD_SOURCEBRANCH: $(Build.SourceBranch)
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
githubApiToken: $(githubApiToken)


- job: RNMacOSInitNpmJSPublish
displayName: react-native-macos-init Publish to npmjs.org
pool:
Expand Down Expand Up @@ -109,6 +115,11 @@ jobs:
inputs:
versionSpec: '>=4.6.4'

- task: CmdLine@2
displayName: "Rename package to react-native"
inputs:
script: node .ado/renamePackageForOffice.js

- task: CmdLine@2
displayName: npm install
inputs:
Expand All @@ -117,7 +128,7 @@ jobs:
- task: CmdLine@2
displayName: Bump package version
inputs:
script: node .ado/bumpFileVersions.js
script: node .ado/bumpOfficeFileVersions.js

- task: NuGetCommand@2
displayName: NuGet restore
Expand Down Expand Up @@ -201,9 +212,9 @@ jobs:
buildProperties: buildNumber=$(buildNumber);commitId=$(Build.SourceVersion)

- task: CmdLine@2
displayName: Do Publish
displayName: 'Npm pack'
inputs:
script: node .ado/publish.js
script: node .ado/npmOfficePack.js
env:
BUILD_STAGINGDIRECTORY: $(Build.StagingDirectory)
BUILD_SOURCEBRANCH: $(Build.SourceBranch)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// @ts-check
const {updatePackageName} = require('./versionUtils');
updatePackageName('react-native-macos');
updatePackageName('react-native');
8 changes: 5 additions & 3 deletions .ado/templates/apple-job-javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ steps:
- script: 'yarn install'
displayName: 'yarn install'

- script: 'yarn test-ci'
displayName: 'yarn test-ci'

- task: CmdLine@2
displayName: yarn test-ci
inputs:
script: 'yarn test-ci'

- script: 'yarn flow-check-ios'
displayName: 'yarn flow-check-ios'

Expand Down
Loading

0 comments on commit c57270f

Please sign in to comment.