diff --git a/bitrise.yml b/bitrise.yml index 2f64a0af..be8c0ad8 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -7,6 +7,8 @@ app: # define these in your .bitrise.secrets.yml - CODECOV_TOKEN: $CODECOV_TOKEN - OPTIONS: $OPTIONS + - OS: $OS + - VERSION: $VERSION workflows: # ---------------------------------------------------------------- diff --git a/step.sh b/step.sh index 687c0529..5d69b0fd 100644 --- a/step.sh +++ b/step.sh @@ -9,13 +9,15 @@ fi # Download and verify Codecov uploader curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step -curl -Os "https://uploader.codecov.io/latest/${OS}/codecov" -curl -Os "https://uploader.codecov.io/latest/${OS}/codecov.SHA256SUM" -curl -Os "https://uploader.codecov.io/latest/${OS}/codecov.SHA256SUM.sig" +curl -Os "https://uploader.codecov.io/${VERSION}/${OS}/codecov" +curl -Os "https://uploader.codecov.io/${VERSION}/${OS}/codecov.SHA256SUM" +curl -Os "https://uploader.codecov.io/${VERSION}/${OS}/codecov.SHA256SUM.sig" gpgv codecov.SHA256SUM.sig codecov.SHA256SUM shasum -a 256 -c codecov.SHA256SUM chmod +x codecov +curl -H "Accept: application/json" "https://uploader.codecov.io/${OS}/${VERSION}" | grep -o '\"version\":\"v[0-9\.\_]\+\"' | head -1 + # Upload coverage to Codecov ./codecov -Q "bitrise-step-3.0.0" -Z "${other_options}" diff --git a/step.yml b/step.yml index 3cede37a..b715dd92 100644 --- a/step.yml +++ b/step.yml @@ -31,6 +31,13 @@ inputs: Name of the OS being used (options are "alpine" | "linux" | "macos") is_required: true is_sensitive: false + - VERSION: "latest" + opts: + title: "Uploader Version" + description: | + Version of the Codecov Uploader to use (e.g. `v0.1.0_8880`) + is_required: false + is_sensitive: false - other_options: "-C $BITRISE_GIT_COMMIT" opts: title: Additional options for Codecov call