Skip to content

Commit 0b35c9e

Browse files
chore(release): 7.1.0 (#1971)
* chore(release): 7.1.0 Bump the wrapper submodule to 0.3.0 and expose the new cleanup input for downloading the CLI into a temporary directory. Co-authored-by: Cursor <[email protected]> * docs: drop release-note README copy Remove CircleCI and changelog-style release notes from README; input docs remain in action.yml, upload.yml, and step.yml. Co-authored-by: Cursor <[email protected]> --------- Co-authored-by: Cursor <[email protected]>
1 parent fb8b358 commit 0b35c9e

5 files changed

Lines changed: 49 additions & 17 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ Codecov's Action supports inputs from the user. These inputs, along with their d
137137
| :--- | :--- | :---: |
138138
| `base_sha` | 'The base SHA to select. This is only used in the "pr-base-picking" run command' | Optional
139139
| `binary` | The file location of a pre-downloaded version of the CLI. If specified, integrity checking will be bypassed. | Optional
140+
| `cleanup` | If true, download the CLI into a temporary directory and clean it up after the run. Off by default. | Optional
140141
| `codecov_yml_path` | The location of the codecov.yml file. This is currently ONLY used for automated test selection (https://docs.codecov.com/docs/getting-started-with-ats). Note that for all other cases, the Codecov yaml will need to be located as described here: https://docs.codecov.com/docs/codecov-yaml#can-i-name-the-file-codecovyml | Optional
141142
| `commit_parent` | SHA (with 40 chars) of what should be the parent of this commit. | Optional
142143
| `directory` | Folder to search for coverage files. Default to the current working directory | Optional

‎action.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ inputs:
1010
binary:
1111
description: 'The file location of a pre-downloaded version of the CLI. If specified, integrity checking will be bypassed.'
1212
required: false
13+
cleanup:
14+
description: 'If true, download the CLI into a temporary directory and clean it up after the run. Off by default to preserve legacy behavior of downloading into the current working directory.'
15+
required: false
16+
default: 'false'
1317
codecov_yml_path:
1418
description: 'The location of the codecov.yml file. This is crrently ONLY used for automated test selection (https://docs.codecov.com/docs/getting-started-with-ats). Note that for all other cases, the Codecov yaml will need to be located as described here: https://docs.codecov.com/docs/codecov-yaml#can-i-name-the-file-codecovyml'
1519
required: false
@@ -317,6 +321,7 @@ runs:
317321
CC_BINARY: ${{ inputs.binary }}
318322
CC_BUILD: ${{ inputs.override_build }}
319323
CC_BUILD_URL: ${{ inputs.override_build_url }}
324+
CC_CLEANUP: ${{ inputs.cleanup }}
320325
CC_CODE: ${{ inputs.report_code }}
321326
CC_DIR: ${{ inputs.directory }}
322327
CC_DISABLE_FILE_FIXES: ${{ inputs.disable_file_fixes }}

‎dist/codecov.sh‎

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ g="\033[0;32m" # info/debug
3737
r="\033[0;31m" # errors
3838
x="\033[0m"
3939
retry="--retry 5 --retry-delay 2"
40-
CC_WRAPPER_VERSION="0.2.9"
40+
CC_WRAPPER_VERSION="0.3.0"
4141
CC_VERSION="${CC_VERSION:-latest}"
4242
CC_FAIL_ON_ERROR="${CC_FAIL_ON_ERROR:-false}"
4343
CC_RUN_CMD="${CC_RUN_CMD:-upload-coverage}"
4444
CC_CLI_TYPE=${CC_CLI_TYPE:-"codecov-cli"}
45+
CC_CLEANUP="${CC_CLEANUP:-false}"
4546
say " _____ _
4647
/ ____| | |
4748
| | ___ __| | ___ ___ _____ __
@@ -63,7 +64,7 @@ then
6364
else
6465
exit_if_error "Could not find binary file $CC_BINARY"
6566
fi
66-
elif [ "$CC_USE_PYPI" == "true" ];
67+
elif [ "$CC_USE_PYPI" == "true" ] || [ "$CC_USE_PYPI" == "1" ];
6768
then
6869
if ! pip install "${CC_CLI_TYPE}$([ "$CC_VERSION" == "latest" ] && echo "" || echo "==$CC_VERSION")"; then
6970
exit_if_error "Could not install via pypi."
@@ -77,6 +78,14 @@ then
7778
CC_COMMAND="${CC_CLI_TYPE}"
7879
fi
7980
else
81+
CC_DOWNLOAD_DIR="."
82+
if [ "$CC_CLEANUP" == "true" ]; then
83+
CC_DOWNLOAD_DIR=$(mktemp -d)
84+
cleanup_downloads() {
85+
rm -rf "$CC_DOWNLOAD_DIR"
86+
}
87+
trap cleanup_downloads EXIT
88+
fi
8089
if [ -n "$CC_OS" ];
8190
then
8291
say "$g==>$x Overridden OS: $b${CC_OS}$x"
@@ -93,47 +102,59 @@ else
93102
fi
94103
CC_FILENAME="${CC_CLI_TYPE%-cli}"
95104
[[ $CC_OS == "windows" ]] && CC_FILENAME+=".exe"
96-
CC_COMMAND="./$CC_FILENAME"
105+
CC_COMMAND="$CC_DOWNLOAD_DIR/$CC_FILENAME"
97106
[[ $CC_OS == "macos" ]] && \
98107
! command -v gpg 2>&1 >/dev/null && \
99108
HOMEBREW_NO_AUTO_UPDATE=1 brew install gpg
100109
CC_URL="${CC_CLI_URL:-https://cli.codecov.io}"
101110
CC_URL="$CC_URL/${CC_VERSION}"
102111
CC_URL="$CC_URL/${CC_OS}/${CC_FILENAME}"
103112
say "$g ->$x Downloading $b${CC_URL}$x"
104-
curl -O $retry "$CC_URL"
113+
curl -o "$CC_COMMAND" $retry "$CC_URL"
105114
say "$g==>$x Finishing downloading $b${CC_OS}:${CC_VERSION}$x"
106115
v_url="https://cli.codecov.io/api/${CC_OS}/${CC_VERSION}"
107116
v=$(curl $retry --retry-all-errors -s "$v_url" -H "Accept:application/json" | tr \{ '\n' | tr , '\n' | tr \} '\n' | grep "\"version\"" | awk -F'"' '{print $4}' | tail -1)
108117
say " Version: $b$v$x"
109118
say " "
110119
fi
111-
if [ "$CC_SKIP_VALIDATION" == "true" ] || [ -n "$CC_BINARY" ] || [ "$CC_USE_PYPI" == "true" ];
120+
if [ "$CC_SKIP_VALIDATION" == "true" ] || [ "$CC_SKIP_VALIDATION" == "1" ] || [ -n "$CC_BINARY" ] || [ "$CC_USE_PYPI" == "true" ] || [ "$CC_USE_PYPI" == "1" ];
112121
then
113122
say "$r==>$x Bypassing validation..."
114-
if [ "$CC_SKIP_VALIDATION" == "true" ];
123+
if [ "$CC_SKIP_VALIDATION" == "true" ] || [ "$CC_SKIP_VALIDATION" == "1" ];
115124
then
116125
chmod +x "$CC_COMMAND"
117126
fi
118127
else
119-
echo "$(curl -s https://keybase.io/codecovsecops/pgp_keys.asc)" | \
120-
gpg --no-default-keyring --import
121-
# One-time step
128+
gpg_key_url="https://keybase.io/codecovsecops/pgp_keys.asc"
129+
gpg_import_ok=false
130+
for gpg_attempt in 1 2 3; do
131+
if curl -sf $retry "$gpg_key_url" | gpg --no-default-keyring --import; then
132+
gpg_import_ok=true
133+
break
134+
fi
135+
if [ "$gpg_attempt" -lt 3 ]; then
136+
say "$r ->$x GPG key import attempt $gpg_attempt failed, retrying..."
137+
sleep 2
138+
fi
139+
done
140+
if [ "$gpg_import_ok" != "true" ]; then
141+
exit_if_error "Could not import GPG verification key after 3 attempts. Please contact Codecov if problem continues"
142+
fi
122143
say "$g==>$x Verifying GPG signature integrity"
123144
sha_url="https://cli.codecov.io"
124145
sha_url="${sha_url}/${CC_VERSION}/${CC_OS}"
125146
sha_url="${sha_url}/${CC_FILENAME}.SHA256SUM"
126147
say "$g ->$x Downloading $b${sha_url}$x"
127148
say "$g ->$x Downloading $b${sha_url}.sig$x"
128149
say " "
129-
curl -Os $retry --connect-timeout 2 "$sha_url"
130-
curl -Os $retry --connect-timeout 2 "${sha_url}.sig"
131-
if ! gpg --verify "${CC_FILENAME}.SHA256SUM.sig" "${CC_FILENAME}.SHA256SUM";
150+
curl -o "$CC_DOWNLOAD_DIR/${CC_FILENAME}.SHA256SUM" -s $retry --connect-timeout 2 "$sha_url"
151+
curl -o "$CC_DOWNLOAD_DIR/${CC_FILENAME}.SHA256SUM.sig" -s $retry --connect-timeout 2 "${sha_url}.sig"
152+
if ! gpg --verify "$CC_DOWNLOAD_DIR/${CC_FILENAME}.SHA256SUM.sig" "$CC_DOWNLOAD_DIR/${CC_FILENAME}.SHA256SUM";
132153
then
133154
exit_if_error "Could not verify signature. Please contact Codecov if problem continues"
134155
fi
135-
if ! (shasum -a 256 -c "${CC_FILENAME}.SHA256SUM" 2>/dev/null || \
136-
sha256sum -c "${CC_FILENAME}.SHA256SUM");
156+
if ! (cd "$CC_DOWNLOAD_DIR" && (shasum -a 256 -c "${CC_FILENAME}.SHA256SUM" 2>/dev/null || \
157+
sha256sum -c "${CC_FILENAME}.SHA256SUM"));
137158
then
138159
exit_if_error "Could not verify SHASUM. Please contact Codecov if problem continues"
139160
fi
@@ -143,11 +164,16 @@ else
143164
fi
144165
if [ -n "$CC_BINARY_LOCATION" ];
145166
then
146-
mkdir -p "$CC_BINARY_LOCATION" && mv "$CC_FILENAME" $_
167+
mkdir -p "$CC_BINARY_LOCATION" && mv "$CC_COMMAND" "$CC_BINARY_LOCATION/$CC_FILENAME"
168+
CC_COMMAND="$CC_BINARY_LOCATION/$CC_FILENAME"
147169
say "$g==>$x ${CC_CLI_TYPE} binary moved to ${CC_BINARY_LOCATION}"
148170
fi
149171
if [ "$CC_DOWNLOAD_ONLY" = "true" ];
150172
then
173+
if [ "$CC_CLEANUP" == "true" ] && [ -z "$CC_BINARY_LOCATION" ]; then
174+
cp "$CC_COMMAND" "./$CC_FILENAME"
175+
CC_COMMAND="./$CC_FILENAME"
176+
fi
151177
say "$g==>$x ${CC_CLI_TYPE} download only called. Exiting..."
152178
exit
153179
fi

‎src/version‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.0.0
1+
7.1.0

0 commit comments

Comments
 (0)