Skip to content

Commit 48951c3

Browse files
authored
deploy: Enable real publishes to pypi and gcs (#85)
Enables the real publishing steps for both prevent-cli and codecov-cli.
1 parent 0b79992 commit 48951c3

2 files changed

Lines changed: 37 additions & 44 deletions

File tree

.craft.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ targets:
1212
- algorithm: sha256
1313
includeNames: /^(sentry-prevent-|sentry_prevent_|codecov|codecov_)cli.*/i
1414

15-
# - name: pypi
15+
- name: pypi
16+
includeNames: /sentry_prevent_cli-*/i

.github/workflows/release-codecov-cli.yml

Lines changed: 35 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,50 +10,42 @@ permissions:
1010
contents: read
1111

1212
jobs:
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

Comments
 (0)