github.com/Uhtred009/v2ray-core-1@v4.31.2+incompatible/release/bleedingrelease.sh (about) 1 #!/usr/bin/env bash 2 3 RELBODY="https://github.com/v2fly/v2ray-core/commit/${RELEASE_SHA}" 4 JSON_DATA=$(echo "{}" | jq -c ".tag_name=\"${RELEASE_TAG}\"") 5 JSON_DATA=$(echo ${JSON_DATA} | jq -c ".prerelease=${PRERELEASE}") 6 JSON_DATA=$(echo ${JSON_DATA} | jq -c ".body=\"${RELBODY}\"") 7 RELEASE_DATA=$(curl --data "${JSON_DATA}" -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/v2fly/V2FlyBleedingEdgeBinary/releases) 8 echo $RELEASE_DATA 9 RELEASE_ID=$(echo $RELEASE_DATA | jq ".id") 10 11 function uploadfile() { 12 FILE=$1 13 CTYPE=$(file -b --mime-type $FILE) 14 15 sleep 1 16 curl -H "Authorization: token ${GITHUB_TOKEN}" -H "Content-Type: ${CTYPE}" --data-binary @$FILE "https://uploads.github.com/repos/v2fly/V2FlyBleedingEdgeBinary/releases/${RELEASE_ID}/assets?name=$(basename $FILE)" 17 sleep 1 18 } 19 20 function upload() { 21 FILE=$1 22 DGST=$1.dgst 23 openssl dgst -md5 $FILE | sed 's/([^)]*)//g' >>$DGST 24 openssl dgst -sha1 $FILE | sed 's/([^)]*)//g' >>$DGST 25 openssl dgst -sha256 $FILE | sed 's/([^)]*)//g' >>$DGST 26 openssl dgst -sha512 $FILE | sed 's/([^)]*)//g' >>$DGST 27 uploadfile $FILE 28 uploadfile $DGST 29 } 30 31 ART_ROOT=${WORKDIR}/bazel-bin/release 32 33 pushd ${ART_ROOT} 34 { 35 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen version ${RELEASE_TAG} 36 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen project "v2flyunstable" 37 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-macos-64.zip 38 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-windows-64.zip 39 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-windows-32.zip 40 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-windows-arm32-v7a.zip 41 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-64.zip 42 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-32.zip 43 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-arm64-v8a.zip 44 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-arm32-v7a.zip 45 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-arm32-v6.zip 46 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-arm32-v5.zip 47 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-mips64.zip 48 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-mips64le.zip 49 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-mips32.zip 50 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-mips32le.zip 51 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-ppc64.zip 52 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-ppc64le.zip 53 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-riscv64.zip 54 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-s390x.zip 55 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-freebsd-64.zip 56 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-freebsd-32.zip 57 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-openbsd-64.zip 58 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-openbsd-32.zip 59 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-dragonfly-64.zip 60 } >Release.unsigned.unsorted 61 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen sort < Release.unsigned.unsorted > Release.unsigned 62 63 { 64 echo "Build Finished" 65 echo "https://github.com/v2fly/V2FlyBleedingEdgeBinary/releases/tag/${RELEASE_TAG}" 66 } > buildcomment 67 68 go run github.com/xiaokangwang/V2BuildAssist/v2buildutil post commit "${RELEASE_SHA}" < buildcomment 69 popd 70 71 upload ${ART_ROOT}/v2ray-macos-64.zip 72 upload ${ART_ROOT}/v2ray-windows-64.zip 73 upload ${ART_ROOT}/v2ray-windows-32.zip 74 upload ${ART_ROOT}/v2ray-windows-arm32-v7a.zip 75 upload ${ART_ROOT}/v2ray-linux-64.zip 76 upload ${ART_ROOT}/v2ray-linux-32.zip 77 upload ${ART_ROOT}/v2ray-linux-arm64-v8a.zip 78 upload ${ART_ROOT}/v2ray-linux-arm32-v7a.zip 79 upload ${ART_ROOT}/v2ray-linux-arm32-v6.zip 80 upload ${ART_ROOT}/v2ray-linux-arm32-v5.zip 81 upload ${ART_ROOT}/v2ray-linux-mips64.zip 82 upload ${ART_ROOT}/v2ray-linux-mips64le.zip 83 upload ${ART_ROOT}/v2ray-linux-mips32.zip 84 upload ${ART_ROOT}/v2ray-linux-mips32le.zip 85 upload ${ART_ROOT}/v2ray-linux-ppc64.zip 86 upload ${ART_ROOT}/v2ray-linux-ppc64le.zip 87 upload ${ART_ROOT}/v2ray-linux-riscv64.zip 88 upload ${ART_ROOT}/v2ray-linux-s390x.zip 89 upload ${ART_ROOT}/v2ray-freebsd-64.zip 90 upload ${ART_ROOT}/v2ray-freebsd-32.zip 91 upload ${ART_ROOT}/v2ray-openbsd-64.zip 92 upload ${ART_ROOT}/v2ray-openbsd-32.zip 93 upload ${ART_ROOT}/v2ray-dragonfly-64.zip 94 upload ${ART_ROOT}/Release.unsigned