name: 'Setup Weld CLI' description: 'Downloads Weld CLI from Gitea releases and adds it to the PATH.' inputs: weld-version: description: 'Version to install (e.g., v0.2.0). Defaults to latest.' required: false default: 'latest' repo: description: 'The owner/repo on Gitea.' required: false default: 'interkonnekted/weld' token: description: 'Gitea Personal Access Token (PAT).' required: true runs: using: "composite" steps: - name: Get Release Metadata id: get_version shell: bash run: | GITEA_URL="https://git.xenoxindustries.com" if [[ "${{ inputs.weld-version }}" == "latest" ]]; then ENDPOINT="api/v1/repos/${{ inputs.repo }}/releases/latest" else ENDPOINT="api/v1/repos/${{ inputs.repo }}/releases/tags/${{ inputs.weld-version }}" fi # Fetch release JSON from Gitea API RESPONSE=$(curl -sL -H "Authorization: token ${{ inputs.token }}" "$GITEA_URL/$ENDPOINT") echo $RESPONSE # Extract Tag and Download URL for the asset named 'weld' TAG=$(echo $RESPONSE | jq -r '.tag_name') # This jq filter finds the asset named 'weld' and gets its download URL DL_URL=$(echo $RESPONSE | jq -r '.assets[] | select(.name=="weld") | .browser_download_url') echo "tag=$TAG" >> $GITHUB_OUTPUT echo "url=$DL_URL" >> $GITHUB_OUTPUT - name: Download Weld CLI shell: bash run: | echo "Downloading Weld from ${{ steps.get_version.outputs.url }}..." curl -L -H "Authorization: token ${{ inputs.token }}" \ -o ./weld \ "${{ steps.get_version.outputs.url }}" echo "Download complete." - name: Make Weld CLI executable shell: bash run: chmod +x ./weld - name: Add Weld CLI to PATH shell: bash run: echo "$(pwd)" >> $GITHUB_PATH