Skip to content

Commit

Permalink
chore: remove the Agent JS and bootstrap entirely from dfx release (d…
Browse files Browse the repository at this point in the history
  • Loading branch information
hansl authored Mar 23, 2021
1 parent 95c9e1c commit 9289555
Show file tree
Hide file tree
Showing 15 changed files with 9 additions and 394 deletions.
5 changes: 0 additions & 5 deletions assets.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{ pkgs ? import ./nix {}
, bootstrap-js ? import ./nix/agent-js/bootstrap-js.nix { inherit pkgs; }
, distributed-canisters ? import ./distributed-canisters.nix { inherit pkgs; }
}:
let
Expand All @@ -13,10 +12,6 @@ let
cp ${pkgs.motoko.mo-ide}/bin/mo-ide $out
cp ${pkgs.motoko.moc}/bin/moc $out
cp ${pkgs.ic-ref}/bin/* $out
# Install bootstrap
mkdir $out/bootstrap
cp -R ${bootstrap-js.dist}/* $out/bootstrap/
'';
in
pkgs.runCommandNoCCLocal "assets" {} ''
Expand Down
9 changes: 1 addition & 8 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,9 @@ rec {
e2e-tests = import ./e2e { inherit pkgs dfx system; };
e2e-tests-ic-ref = import ./e2e { inherit pkgs dfx system; use_ic_ref = true; };

# Agents in varous languages
agent-js-monorepo = pkgs.agent-js-monorepo;
agent-js = import ./nix/agent-js/agent-js.nix { inherit system pkgs; };

# Bootstrap frontend.
bootstrap-js = import ./nix/agent-js/bootstrap-js.nix { inherit system pkgs; };

cargo-audit = import ./cargo-audit.nix { inherit pkgs RustSec-advisory-db; };

assets = import ./assets.nix { inherit pkgs bootstrap-js distributed-canisters; };
assets = import ./assets.nix { inherit pkgs distributed-canisters; };

distributed-canisters = import ./distributed-canisters.nix { inherit pkgs; };

Expand Down
83 changes: 6 additions & 77 deletions docs/process/release.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Our goal is to update this document with the latest information as we iterate to

Before you begin, verify the following prerequisites for the release process *driver*:

- You must have a GitHub account and access to the `+dfinity+` organization and core repositories like the `sdk` and `agent-js` repositories
- You must have a GitHub account and access to the `+dfinity+` organization and core repositories like the `sdk` repository
+
For information about setting up a GitHub account, see link:https://docs.github.com/en/github/getting-started-with-github/signing-up-for-a-new-github-account[Signin up for a GitHub account]
To get permission for your account to access `+dfinity-lab+` and `+dfinity+` repositories, see link:https://www.notion.so/How-to-Get-Github-Access-68c9ad72b5974fa9bbec003592677d02[How to get GitHub access).
Expand Down Expand Up @@ -95,13 +95,13 @@ After running this command to build the release candidate, follow the steps in <
[[manual]]
== MANUAL STEPS release process

The manual release process provides full instructions for building and testing the release candidate binaries to ensure everything is working before making a release available to internal or external developers.
The manual release process provides full instructions for building and testing the release candidate binaries to ensure everything is working before making a release available to internal or external developers.

=== Build DFX and the JavaScript agent binaries
=== Build DFX

Verify that you can build DFX and the JavaScript agent from the `+master+` branch without errors.
Verify that you can build DFX from the `+master+` branch without errors.

. Verify you're connected to VPN, if necessary.
. Verify you're connected to VPN, if necessary.
. Build the `dfx` binary by running the following command:
+
[source, bash]
Expand All @@ -112,7 +112,7 @@ export dfx_rc="$sdk_rc/bin/dfx"
+
The `nix-build` command can take a while to complete.
Wait for it to be done.
These commands create the binary then stores the binary in a shell variable.
These commands create the binary then stores the binary in a shell variable.
. Make sure the `$dfx_rc` variable points to a real file by running the following command:
+
```
Expand All @@ -127,24 +127,6 @@ You should see 'Please proceed' returned.
[source, bash]
----
$dfx_rc cache delete
----
. Build the JavaScript agent by running the following commands:
+
[source, bash]
----
export agent_js_rc="$(nix-build . -A agent-js --option extra-binary-caches https://cache.dfinity.systems)"
export agent_js_rc_npm_packed="$(sh -c 'echo "$1"' sh $agent_js_rc/dfinity-agent-*.tgz)"
----
. Make sure the agent package was created by running the following command:
+
[source,bash]
----
test -f $agent_js_rc_npm_packed \
&& echo 'Please proceed' \
|| echo 'Cannot find npm-packed dfinity-agent-*.tgz'
----
+
You should see 'Please proceed' returned.
. Ensure `dfx` and `replica` are not running in the background by running the following command:
+
[source, bash]
Expand All @@ -165,12 +147,6 @@ Verify that you can build, deploy, and call the default `hello_world` project wi
$dfx_rc new hello_world
cd hello_world
----
. Install the locally-built JavaScript agent for the new project by running the following command:
+
[source, bash]
----
npm install "$agent_js_rc_npm_packed"
----
. Start the local `replica` as a background process by running the following command:
+
[source, bash]
Expand Down Expand Up @@ -358,53 +334,6 @@ git push origin stable
Pushing the branch second is an optimization.
Hydra will spur into action when `stable` advances, so if the branch is already tagged, it won't require a second fetch.
==== Publish JavaScript agent to NPM

. Create and switch to a new directory to release from by running the following commands:
+
[source, nix-shell]
----
pushd $(mktemp -d)
cp -R $agent_js_rc/. ./
----

. Change the package.json's `version` property:
+
[source, nix-shell]
----
npm version $NEW_DFX_VERSION
----

. Run the following command to check that every `.js` file has a `.d.ts` assigned and that every `.js` and `.d.ts` file has a source file that is not a test:
+
[source, nix-shell]
----
diff <(find types src \( -name \*.d.ts -o -name \*.js \) -a \! -name \*.test.\* | sort) <(npm publish --dry-run 2>&1 | egrep 'npm notice [0-9.]*k?B' | awk '{ print $4 }' | grep -v package.json | grep -v README.md | sort) && echo Success
----
+
You should see `Success` displayed in the terminal after running this command.
. Log in to npm by running the following command:
+
[source, nix-shell]
----
npm login
----
. Publish to npm by running the following command:
+
[source, nix-shell]
----
npm publish
----
. Log out by running the following command:
+
[source, nix-shell]
----
npm logout
----
ifdef::env-github[]
:tada:
endif::[]

[[post-build]]
== Notification and post-build validation
Expand Down
45 changes: 0 additions & 45 deletions nix/agent-js/agent-js-monorepo.nix

This file was deleted.

37 changes: 0 additions & 37 deletions nix/agent-js/agent-js.nix

This file was deleted.

40 changes: 0 additions & 40 deletions nix/agent-js/bootstrap-js.nix

This file was deleted.

26 changes: 0 additions & 26 deletions nix/agent-js/monorepo-tools.nix

This file was deleted.

4 changes: 0 additions & 4 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ let
napalm = self.callPackage self.sources.napalm {
pkgs = self // { nodejs = self.nodejs-12_x; };
};
agent-js-monorepo = import ./agent-js/agent-js-monorepo.nix {
inherit system pkgs;
agent-js-monorepo-src = self.sources.agent-js-monorepo;
};
ic-ref = (import self.sources.ic-ref { inherit (self) system; }).ic-ref-dist;

nix-fmt = nixFmt.fmt;
Expand Down
6 changes: 0 additions & 6 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@
"url": "https://github.com/RustSec/advisory-db/archive/cda5b3ffd4b0cec5fa20f290e45297ee3f1999ee.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"agent-js-monorepo": {
"ref": "next",
"repo": "ssh://[email protected]/dfinity-lab/agent-js",
"rev": "1c9703fa3abaaa039a1e53d1257a8d6c8333b5b9",
"type": "git"
},
"bats-support": {
"branch": "v0.3.0",
"builtin": false,
Expand Down
Loading

0 comments on commit 9289555

Please sign in to comment.