@@ -10,50 +10,42 @@ permissions:
1010 contents : read
1111
1212jobs :
13- test :
13+ publish_to_pypi :
14+ permissions :
15+ id-token : write # This is required for OIDC
1416 runs-on : ubuntu-latest
1517 steps :
16- - run : echo "hi from build and publish codecov-cli"
18+ - name : Download pypi release assets
19+ uses : robinraju/release-downloader@daf26c55d821e836577a15f77d86ddc078948b05 # v1.12
20+ with :
21+ tag : ${{ github.ref_name }}
22+ fileName : codecov_cli-*
23+ out-file-path : codecov-cli/dist
1724
18- # publish_to_pypi:
19- # permissions:
20- # id-token: write # This is required for OIDC
21- # runs-on: ubuntu-latest
22- # environment:
23- # name: pypi
24- # url: https://pypi.org/p/codecov-cli
25- # steps:
26- # - name: Download build artifacts
27- # uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # v11
28- # with:
29- # branch: release/${{ github.ref }}
30- # name: codecov-cli_wheel
31- # path: codecov-cli/dist
32- #
33- # - name: Publish package to PyPi
34- # uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
35- # with:
36- # verbose: true
37- # packages-dir: codecov-cli/dist
25+ - name : Publish package to PyPi
26+ uses : pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
27+ with :
28+ verbose : true
29+ packages-dir : codecov-cli/dist
3830
39- # publish_release:
40- # name: Publish release
41- # runs-on: ubuntu-latest
42- # permissions:
43- # contents: "read"
44- # id-token: "write"
45- # steps:
46- # - id: "auth"
47- # name: "Authenticate to Google Cloud"
48- # uses: "google-github-actions/auth@v1.0.0"
49- # with:
50- # create_credentials_file: "true"
51- # workload_identity_provider: ${{ secrets.CODECOV_GCP_WIDP }}
52- # service_account: ${{ secrets.CODECOV_GCP_WIDSA }}
53- #
54- # # Publish the release tag to a Pub/Sub topic
55- # - name: Publish a message to a Pub/Sub topic
56- # env:
57- # CLOUDSDK_CORE_PROJECT: ${{ secrets.GCLOUD_UPLOADER_PROJECT_ID }}
58- # run: |
59- # gcloud pubsub topics publish ${{ secrets.GCLOUD_UPLOADER_PUBSUB_TOPIC }} --message '{"release":"'"${{ github.ref_name }}"'", "latest":true}'
31+ publish_release :
32+ name : Publish release
33+ runs-on : ubuntu-latest
34+ permissions :
35+ contents : " read"
36+ id-token : " write"
37+ steps :
38+ - id : " auth"
39+ name : " Authenticate to Google Cloud"
40+ uses : " google-github-actions/auth@v1.0.0"
41+ with :
42+ create_credentials_file : " true"
43+ workload_identity_provider : ${{ secrets.CODECOV_GCP_WIDP }}
44+ service_account : ${{ secrets.CODECOV_GCP_WIDSA }}
45+
46+ # Publish the release tag to a Pub/Sub topic
47+ - name : Publish a message to a Pub/Sub topic
48+ env :
49+ CLOUDSDK_CORE_PROJECT : ${{ secrets.GCLOUD_UPLOADER_PROJECT_ID }}
50+ run : |
51+ gcloud pubsub topics publish ${{ secrets.GCLOUD_UPLOADER_PUBSUB_TOPIC }} --message '{"release":"'"${{ github.ref_name }}"'", "latest":true}'
0 commit comments