mirror of
https://github.com/codecov/codecov-action.git
synced 2026-04-12 17:10:05 +00:00
feat: Use new Codecov uploader
This commit is contained in:
parent
4463da3901
commit
cf7b8b83b2
6 changed files with 123 additions and 3771 deletions
56
bash/linux
Executable file
56
bash/linux
Executable file
|
|
@ -0,0 +1,56 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
say() {
|
||||
echo -e "$1"
|
||||
}
|
||||
|
||||
curl -Os https://uploader.codecov.io/latest/codecov-linux
|
||||
|
||||
check=0
|
||||
|
||||
r="\033[0;31m"
|
||||
g="\033[0;32m"
|
||||
x="\033[0m"
|
||||
|
||||
if [ $# != 0 ];
|
||||
then
|
||||
while getopts "cv-" o
|
||||
do
|
||||
case "$o" in
|
||||
"-")
|
||||
say "${r}Long options are not supported${x}"
|
||||
exit 2
|
||||
;;
|
||||
"c")
|
||||
check=1
|
||||
;;
|
||||
"v")
|
||||
;;
|
||||
*)
|
||||
say "${r}Unexpected flag not supported${x}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$check" != 0 ];
|
||||
then
|
||||
gpg --import bash/pgp_keys.asc
|
||||
curl -Os https://uploader.codecov.io/latest/codecov-linux
|
||||
curl -Os https://uploader.codecov.io/latest/codecov-linux.SHA256SUM
|
||||
curl -Os https://uploader.codecov.io/latest/codecov-linux.SHA256SUM.sig
|
||||
|
||||
# Verify the SHASUM
|
||||
gpg --verify codecov-linux.SHA256SUM.sig codecov-linux.SHA256SUM || (say "${r}SHA256SUM verification failed${x}" && exit 1)
|
||||
say "${g}-> codecov-linux.SHA256SUM verified${x}"
|
||||
shasum -a 256 -c codecov-linux.SHA256SUM || (say "${r}codecov-linux SHASUM check failed${x}" && exit 1)
|
||||
say "${g}-> codecov-linux verified${x}"
|
||||
|
||||
#Clean up
|
||||
unlink codecov-linux.SHA256SUM.sig
|
||||
unlink codecov-linux.SHA256SUM
|
||||
fi
|
||||
|
||||
chmod +x codecov-linux
|
||||
Loading…
Add table
Add a link
Reference in a new issue