Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow publishes the codecov-cli assets to PyPI and our GCS bucket | |
| # when a release is created. | |
| name: Build and publish codecov-cli | |
| on: | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: read | |
| jobs: | |
| publish_to_pypi: | |
| permissions: | |
| id-token: write # This is required for OIDC | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download pypi release assets | |
| uses: robinraju/release-downloader@daf26c55d821e836577a15f77d86ddc078948b05 # v1.12 | |
| with: | |
| tag: ${{ github.ref_name }} | |
| fileName: codecov_cli-* | |
| out-file-path: codecov-cli/dist | |
| - name: Publish package to PyPi | |
| uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 | |
| with: | |
| verbose: true | |
| packages-dir: codecov-cli/dist | |
| publish_release: | |
| name: Publish release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: "read" | |
| id-token: "write" | |
| steps: | |
| - id: "auth" | |
| name: "Authenticate to Google Cloud" | |
| uses: "google-github-actions/[email protected]" | |
| with: | |
| create_credentials_file: "true" | |
| workload_identity_provider: ${{ secrets.CODECOV_GCP_WIDP }} | |
| service_account: ${{ secrets.CODECOV_GCP_WIDSA }} | |
| # Publish the release tag to a Pub/Sub topic | |
| - name: Publish a message to a Pub/Sub topic | |
| env: | |
| CLOUDSDK_CORE_PROJECT: ${{ secrets.GCLOUD_UPLOADER_PROJECT_ID }} | |
| run: | | |
| gcloud pubsub topics publish ${{ secrets.GCLOUD_UPLOADER_PUBSUB_TOPIC }} --message '{"release":"'"${{ github.ref_name }}"'", "latest":true}' |