Skip to content

Commit

Permalink
Merge pull request #13 from codecov/specify-version
Browse files Browse the repository at this point in the history
Allow specifying version of Codecov uploader
  • Loading branch information
thomasrockhu-codecov authored Sep 13, 2021
2 parents 269473d + 3eb71b8 commit 60c8786
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ app:
# define these in your .bitrise.secrets.yml
- CODECOV_TOKEN: $CODECOV_TOKEN
- OPTIONS: $OPTIONS
- OS: $OS
- VERSION: $VERSION

workflows:
# ----------------------------------------------------------------
Expand Down
8 changes: 5 additions & 3 deletions step.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
7 changes: 7 additions & 0 deletions step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 60c8786

Please sign in to comment.