Skip to content

Commit

Permalink
chore: specify arch
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason I committed Apr 29, 2024
1 parent 60903bf commit f8ca111
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/provision-darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/provision-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/update-dfx-cache.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"

0 comments on commit f8ca111

Please sign in to comment.