name: setup-aftman description: Github action to install aftman author: ok-nick inputs: version: description: '`aftman` version in the form `vx.x.x`' required: false no-trust-check: description: "Whether to check trusts" default: 'false' required: false trusts: description: 'List of trusted tools separated by spaces' required: false path: description: 'Path to the `aftman.toml` directory' default: '' required: false token: description: 'Github token from `secrets.GITHUB_TOKEN`' required: true runs: using: 'composite' steps: - name: Download aftman if: runner.os == 'Linux' shell: bash run: gh release download ${{ inputs.version }} --repo LPGhatguy/aftman --pattern *linux-x86_64.zip env: GITHUB_TOKEN: ${{ inputs.token }} - name: Download aftman if: runner.os == 'macOS' shell: bash run: gh release download ${{ inputs.version }} --repo LPGhatguy/aftman --pattern *macos-x86_64.zip env: GITHUB_TOKEN: ${{ inputs.token }} - name: Download aftman if: runner.os == 'Windows' shell: bash run: gh release download ${{ inputs.version }} --repo LPGhatguy/aftman --pattern *windows-x86_64.zip env: GITHUB_TOKEN: ${{ inputs.token }} - name: Install aftman shell: bash run: | unzip aftman*.zip ./aftman self-install echo "$HOME/.aftman/bin" >> $GITHUB_PATH - name: Setup trusts if: ${{ inputs.no-trust-check == false }} shell: bash run: | for name in ${{ inputs.trusts }}; do aftman trust $name done - name: Test run: cat ./aftman.toml - name: Install tools shell: bash run: | cd ${{ inputs.path }} if [ ${{ inputs.no-trust-check }} == true ]; then aftman install --no-trust-check else aftman install fi branding: icon: link-2 color: blue