# set up the Trunk web build system
#
#   https://trunkrs.dev
#
# the `curl` call is based on David Tolnay's `rust-toolchain` action
#
#   https://github.com/dtolnay/rust-toolchain
#
runs:
  using: "composite"
  steps:
    - run: rustup target add wasm32-unknown-unknown
    
    # install the Trunk binary to `ci-bin` within the workspace directory, which
    # is determined by the `github.workspace` label and reflected in the
    # `GITHUB_WORKSPACE` environment variable. then, make the `trunk` command
    # available by placing the fully qualified path to `ci-bin` on the
    # workflow's search path
    - run: mkdir -p ci-bin
    - run: curl --output - --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail 'https://github.com/trunk-rs/trunk/releases/download/v0.21.12/trunk-x86_64-unknown-linux-gnu.tar.gz' | tar --gunzip --extract --file -
      working-directory: ci-bin
    - run: echo "${{ github.workspace }}/ci-bin" >> $GITHUB_PATH
