name: Install emsdk (including emcc)
inputs:
  version:
    description: EMCC Version to install
    required: false
    default: 3.1.28

runs:
  using: "composite"
  steps:
    - name: Clone emsdk repo
      working-directory: ${{ runner.temp }}
      shell: bash
      run: git clone https://github.com/emscripten-core/emsdk.git

    - name: emdsk install
      working-directory: ${{ runner.temp }}/emsdk
      shell: bash
      run: |
        ./emsdk install ${{ inputs.version }}
        ./emsdk activate ${{ inputs.version }}
        echo $RUNNER_TEMP/emsdk >> $GITHUB_PATH
        echo $RUNNER_TEMP/emsdk/upstream/emscripten >> $GITHUB_PATH
