From 05d0de7c71a3db3594a41a3b6131a9f774492e8c Mon Sep 17 00:00:00 2001 From: Max Murphy Date: Fri, 22 Sep 2023 11:21:59 +0200 Subject: [PATCH 1/3] Fix latest rust version --- .github/workflows/update-rust.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-rust.yml b/.github/workflows/update-rust.yml index a92e552c6fb..6e3f9cdc346 100644 --- a/.github/workflows/update-rust.yml +++ b/.github/workflows/update-rust.yml @@ -6,6 +6,10 @@ on: # check for new rust versions weekly - cron: '30 3 * * FRI' workflow_dispatch: + push: + branches: + # The development branch for this workflow: + - "update-rust" jobs: rust-update: runs-on: ubuntu-latest @@ -13,13 +17,14 @@ jobs: - uses: actions/checkout@v3 # First, check rust GitHub releases for a new version. We assume that the # latest version's tag name is the version. + - name: Install yq + run: sudo snap install yq - name: Check new rust version id: update run: | current_rust_version=$(cat ./rust-toolchain.toml | sed -n 's/^channel[[:space:]]*=[[:space:]]"\(.*\)"/\1/p') echo "current rust version '$current_rust_version'" - release_data=$(curl --silent -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/rust-lang/rust/releases/latest) - latest_rust_version=$(echo -n "$release_data" | jq -cMr .tag_name) + latest_rust_version=$(curl -sSL https://static.rust-lang.org/dist/channel-rust-stable.toml | yq -oy -p toml '.pkg.rust.target.x86_64-unknown-linux-gnu.url' | sed -E 's!https://.*rust-([0-9]+[.][0-9]+[.][0-9]+).*!\1!g') # The GitHub API has some hiccups, so we check the value before going further if [ -z "$latest_rust_version" ] || [ "$latest_rust_version" = "null" ] From a3ffb165ffa039a3981aca9b924e8e055db07219 Mon Sep 17 00:00:00 2001 From: Max Murphy Date: Fri, 22 Sep 2023 11:42:31 +0200 Subject: [PATCH 2/3] Simpler --- .github/workflows/update-rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-rust.yml b/.github/workflows/update-rust.yml index 6e3f9cdc346..e7e0f050de7 100644 --- a/.github/workflows/update-rust.yml +++ b/.github/workflows/update-rust.yml @@ -24,7 +24,7 @@ jobs: run: | current_rust_version=$(cat ./rust-toolchain.toml | sed -n 's/^channel[[:space:]]*=[[:space:]]"\(.*\)"/\1/p') echo "current rust version '$current_rust_version'" - latest_rust_version=$(curl -sSL https://static.rust-lang.org/dist/channel-rust-stable.toml | yq -oy -p toml '.pkg.rust.target.x86_64-unknown-linux-gnu.url' | sed -E 's!https://.*rust-([0-9]+[.][0-9]+[.][0-9]+).*!\1!g') + latest_rust_version=$(curl -sSL https://static.rust-lang.org/dist/channel-rust-stable.toml | yq -p toml -oy .pkg.rust.version | awk '{print $1}') # The GitHub API has some hiccups, so we check the value before going further if [ -z "$latest_rust_version" ] || [ "$latest_rust_version" = "null" ] From 3873d6ae0c78f71db430b05886c5805729d5903f Mon Sep 17 00:00:00 2001 From: Max Murphy Date: Fri, 22 Sep 2023 11:56:42 +0200 Subject: [PATCH 3/3] +=changelog --- CHANGELOG-Nns-Dapp.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG-Nns-Dapp.md b/CHANGELOG-Nns-Dapp.md index 36f01971242..988330c112f 100644 --- a/CHANGELOG-Nns-Dapp.md +++ b/CHANGELOG-Nns-Dapp.md @@ -45,6 +45,7 @@ The NNS Dapp is released through proposals in the Network Nervous System. Theref #### Added #### Changed +* Fix the rust-update action. * Specify the `snsdemo` version in `dfx.json`. * Make the file list stats accessible in logs and as a file in the release artefacts. * Support using the nns-dapp downgrade-upgrade test with Wasms other than prod.