From 57a7e5cc9cdde48e4222ae4faad3cb2706592e34 Mon Sep 17 00:00:00 2001 From: Eric Swanson Date: Fri, 20 May 2022 10:30:52 -0700 Subject: [PATCH] chore: add script to update motoko --- .github/CONTRIBUTING.adoc | 9 +++++++++ scripts/update-motoko.sh | 21 +++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100755 scripts/update-motoko.sh diff --git a/.github/CONTRIBUTING.adoc b/.github/CONTRIBUTING.adoc index 9a38d32efd..25627bb6c2 100644 --- a/.github/CONTRIBUTING.adoc +++ b/.github/CONTRIBUTING.adoc @@ -93,6 +93,15 @@ To update the replica to a given $SHA from the dfinity repo, execute the followi ./scripts/update-replica.sh $SHA ---- +=== Updating Motoko + +To update Motoko to a given $VERSION from the motoko and motoko-base repos, execute the following: +[source,bash] +---- +# Requires niv to run. To install niv, run nix-env -iA nixpkgs.niv +./scripts/update-motoko.sh $VERSION +---- + === Licenses https://hydra.oregon.dfinity.build/latest/dfinity-ci-build/sdk/licenses.dfx.x86_64-linux/licenses.dfinity-sdk-dfx.html[Latest licenses of all dependencies of dfx (build for x86_64-linux)]. diff --git a/scripts/update-motoko.sh b/scripts/update-motoko.sh new file mode 100755 index 0000000000..0390a8ac69 --- /dev/null +++ b/scripts/update-motoko.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -e + +# $1 not set || not running in repo root +if [ -z ${1+x} ] || [ ! -f ./scripts/write-dfx-asset-sources.sh ]; then + echo "Usage: run ./scripts/update-motoko.sh in repo root" + exit 1 +fi + +VERSION=$1 +echo "Updating sources to version ${VERSION}" +niv update motoko-base +niv update motoko-base-tarball -a version=$VERSION +niv update motoko-x86_64-darwin -a version=$VERSION +niv update motoko-x86_64-linux -a version=$VERSION + +echo "Writing asset sources" +./scripts/write-dfx-asset-sources.sh + +echo "Done. Don't forget to update CHANGELOG.adoc"