dfx v0.17.0 CI migration guide
Advanced
dfxvm
is a new tool used for installing and managing different versions of dfx
. In dfx
versions 0.17.0 and newer, dfxvm
is used to install and update dfx
. This means CI jobs that install dfx
will need to update their workflow.
GitHub actions
If your CI job uses GitHub actions, you can edit your dfx
install job to use the following configuration:
jobs:
example-job:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dfx
uses: dfinity/setup-dfx@main
- name: Confirm successful installation
run: dfx --version
Manual CI job
If you use a manual CI job, you will need to follow these steps:
- Set
DFXVM_INIT_YES=true
so that the installer bypasses prompts:
DFXVM_INIT_YES=true sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
- Add the path for
dfxvm bin
to your PATH variable:
# Linux:
"$HOME/.local/share/dfx/bin"
# Macos:
"$HOME/Library/Application Support/org.dfinity.dfx/bin"
- Depending on the setup of your CI script, you may need to source the
dfx/env
script as well:
# Linux:
source "$HOME/.local/share/dfx/env"
# Macos:
source "$HOME/Library/Application Support/org.dfinity.dfx/env"
Docker
For CI jobs that use Docker environments, the following Dockerfile configuration can be used:
ARG DFX_VERSION
RUN DFXVM_INIT_YES=true sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
RUN . $HOME/.local/share/dfx/env
ENV PATH="/root/.local/share/dfx/bin:$PATH"