How can I add an executable to my path in a CircleCI job?

I am downloading and unzipping binaryen in a run step.

- run: wget -c https://github.com/WebAssembly/binaryen/releases/download/version_101/binaryen-version_101-x86_64-linux.tar.gz -O - | tar -xz -C /tmp/

I am then updating the path in $BASH_ENV.

- run: echo "export PATH=/tmp/binaryen-version_101/bin/wasm-opt:\${PATH}" >> $BASH_ENV

However, I still get a command not found for wasm-opt.

How can I install the downloaded wasm-opt binary such that another run step can use it?

Try a run command with multiple lines. Ex:

  • run:
    name: “Publish to Store”
    command: |
    mkdir .snapcraft
    echo $SNAPCRAFT_LOGIN_FILE | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg
    snapcraft push *.snap --release stable