github.com/v2fly/v2ray-core/v4@v4.45.2/release/requestsign.sh (about) 1 #!/usr/bin/env bash 2 3 RELEASE_DATA=$(curl --data "version=${SIGN_VERSION}" --data "password=${SIGN_SERVICE_PASSWORD}" -X POST "${SIGN_SERIVCE_URL}" ) 4 echo $RELEASE_DATA 5 RELEASE_ID=$(echo $RELEASE_DATA| jq -r ".id") 6 7 function uploadfile() { 8 FILE=$1 9 CTYPE=$(file -b --mime-type $FILE) 10 11 sleep 1 12 curl -H "Authorization: token ${GITHUB_TOKEN}" -H "Content-Type: ${CTYPE}" --data-binary @$FILE "https://uploads.github.com/repos/v2fly/v2ray-core/releases/${RELEASE_ID}/assets?name=$(basename $FILE)" 13 sleep 1 14 } 15 16 function upload() { 17 FILE=$1 18 DGST=$1.dgst 19 openssl dgst -md5 $FILE | sed 's/([^)]*)//g' >> $DGST 20 openssl dgst -sha1 $FILE | sed 's/([^)]*)//g' >> $DGST 21 openssl dgst -sha256 $FILE | sed 's/([^)]*)//g' >> $DGST 22 openssl dgst -sha512 $FILE | sed 's/([^)]*)//g' >> $DGST 23 uploadfile $FILE 24 uploadfile $DGST 25 } 26 27 curl "https://raw.githubusercontent.com/v2fly/Release/master/v2fly/${SIGN_VERSION}.Release" > Release 28 upload Release