Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1378,12 +1378,14 @@ jobs:
- checkout
- *attach_hermes_workspace
- run:
name: Copy HermesC binaries
name: Copy Hermes binaries
command: |
mkdir -p ./sdks/hermesc ./sdks/hermesc/osx-bin ./sdks/hermesc/win64-bin ./sdks/hermesc/linux64-bin
cp -r $HERMES_WS_DIR/osx-bin/* ./sdks/hermesc/osx-bin/.
cp -r $HERMES_WS_DIR/win64-bin/* ./sdks/hermesc/win64-bin/.
cp -r $HERMES_WS_DIR/linux64-bin/* ./sdks/hermesc/linux64-bin/.
mkdir -p ./ReactAndroid/external-artifacts/artifacts/
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-runtime-darwin-debug-*.tar.gz ./ReactAndroid/external-artifacts/artifacts/hermes-ios.tar.gz

- run_yarn
- download_gradle_dependencies
Expand Down
5 changes: 5 additions & 0 deletions scripts/publish-npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const {
} = require('./scm-utils');
const {
generateAndroidArtifacts,
publishAndroidArtifactsToMaven,
saveFilesToRestore,
} = require('./release-utils');
const fs = require('fs');
Expand Down Expand Up @@ -196,6 +197,10 @@ const isLatest = exitIfNotOnGit(
'Not in git. We do not want to publish anything',
);

// We first publish on Maven Central all the necessary artifacts.
// NPM publishing is done just after.
publishAndroidArtifactsToMaven(nightlyBuild);

const releaseBranch = `${major}.${minor}-stable`;

// Set the right tag for nightly and prerelease builds
Expand Down
24 changes: 24 additions & 0 deletions scripts/release-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,31 @@ function generateAndroidArtifacts(releaseVersion, tmpPublishingFolder) {
});
}

function publishAndroidArtifactsToMaven(isNightly) {
// -------- Publish every artifact to Maven Central
if (exec('./gradlew publishAllToSonatype -PisNightly=' + isNightly).code) {
echo('Failed to publish artifacts to Sonatype (Maven Central)');
exit(1);
}

if (!isNightly) {
// -------- For stable releases, we also need to close and release the staging repository.
// TODO(ncor): Remove the --dry-run before RC0
if (
exec('./gradlew closeAndReleaseSonatypeStagingRepository --dry-run').code
) {
echo(
'Failed to close and release the staging repository on Sonatype (Maven Central)',
);
exit(1);
}
}

echo('Published artifacts to Maven Central');
}

module.exports = {
generateAndroidArtifacts,
publishAndroidArtifactsToMaven,
saveFilesToRestore,
};