diff --git a/.github/workflows/provision-darwin.sh b/.github/workflows/provision-darwin.sh index c0a00c459..06aac1bfe 100755 --- a/.github/workflows/provision-darwin.sh +++ b/.github/workflows/provision-darwin.sh @@ -31,6 +31,9 @@ if [ -f "${GITHUB_WORKSPACE}/.ic-commit" ]; then current_sha=$(sed <"$GITHUB_WORKSPACE/.ic-commit" 's/#.*$//' | sed '/^$/d') arch="x86_64-darwin" if [ "$current_sha" != "$stable_sha" ]; then + export stable_sha + export current_sha + export arch sh "$GITHUB_WORKSPACE/.github/workflows/update-dfx-cache.sh" fi fi diff --git a/.github/workflows/provision-linux.sh b/.github/workflows/provision-linux.sh index f9cf23e60..228d97e30 100755 --- a/.github/workflows/provision-linux.sh +++ b/.github/workflows/provision-linux.sh @@ -25,6 +25,9 @@ if [ -f "${GITHUB_WORKSPACE}/.ic-commit" ]; then current_sha=$(sed <"$GITHUB_WORKSPACE/.ic-commit" 's/#.*$//' | sed '/^$/d') arch="x86_64-linux" if [ "$current_sha" != "$stable_sha" ]; then + export stable_sha + export current_sha + export arch sh "$GITHUB_WORKSPACE/.github/workflows/update-dfx-cache.sh" fi fi diff --git a/.github/workflows/update-dfx-cache.sh b/.github/workflows/update-dfx-cache.sh index 08c1af636..d3d3406d0 100755 --- a/.github/workflows/update-dfx-cache.sh +++ b/.github/workflows/update-dfx-cache.sh @@ -1,7 +1,5 @@ #!/bin/bash -current_sha=$(sed <"$GITHUB_WORKSPACE/.ic-commit" 's/#.*$//' | sed '/^$/d') - # Download latest ic artifacts curl -O "https://download.dfinity.systems/ic/$current_sha/binaries/$arch/replica.gz" curl -O "https://download.dfinity.systems/ic/$current_sha/binaries/$arch/canister_sandbox.gz" @@ -17,11 +15,11 @@ curl -O "https://download.dfinity.systems/ic/$current_sha/binaries/$arch/sns.gz" gzip -d replica.gz && chmod +x replica && mv replica $(dfx cache show) gzip -d canister_sandbox.gz && chmod +x canister_sandbox && mv canister_sandbox $(dfx cache show) gzip -d ic-starter.gz && chmod +x ic-starter && mv ic-starter $(dfx cache show) -#gzip -d sandbox_launcher.gz && chmod +x sandbox_launcher && mv sandbox_launcher $(dfx cache show) -#gzip -d ic-admin.gz && chmod +x ic-admin && mv ic-admin $(dfx cache show) -#gzip -d ic-btc-adapter.gz && chmod +x ic-btc-adapter && mv ic-btc-adapter $(dfx cache show) -#gzip -d ic-https-outcalls-adapter.gz && chmod +x ic-https-outcalls-adapter && mv ic-https-outcalls-adapter $(dfx cache show) -#gzip -d ic-nns-init.gz && chmod +x ic-nns-init && mv ic-nns-init $(dfx cache show) -#gzip -d sns.gz && chmod +x sns && mv sns $(dfx cache show) +gzip -d sandbox_launcher.gz && chmod +x sandbox_launcher && mv sandbox_launcher $(dfx cache show) +gzip -d ic-admin.gz && chmod +x ic-admin && mv ic-admin $(dfx cache show) +gzip -d ic-btc-adapter.gz && chmod +x ic-btc-adapter && mv ic-btc-adapter $(dfx cache show) +gzip -d ic-https-outcalls-adapter.gz && chmod +x ic-https-outcalls-adapter && mv ic-https-outcalls-adapter $(dfx cache show) +gzip -d ic-nns-init.gz && chmod +x ic-nns-init && mv ic-nns-init $(dfx cache show) +gzip -d sns.gz && chmod +x sns && mv sns $(dfx cache show) echo "dfx cache updated with latest ic artifacts" \ No newline at end of file