This repository was archived by the owner on Jul 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
79 lines (72 loc) · 2.3 KB
/
release_flow.yml
File metadata and controls
79 lines (72 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Build and Publish CLI Release
on:
release:
types:
- created
jobs:
build_for_pypi:
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
uses: ./.github/workflows/build_for_pypi.yml
with:
publish: true
secrets: inherit
buildassets:
name: Build packages
uses: ./.github/workflows/build_assets.yml
with:
release: true
secrets: inherit
publish_to_pypi:
needs:
- build_for_pypi
permissions:
id-token: write # This is required for OIDC
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/codecov-cli
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist/
pattern: cibw-*
- name: Display and move artifacts
run: |
ls -alrt */*/*
mv */*/*/* dist/
mv */*/* dist/
echo "Moved files"
ls -alrt */*
echo "Deleting empty directories"
find . -empty -type d -delete
ls -alrt */*
- name: Publish package to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
publish_release:
name: Publish release
needs: [buildassets, publish_to_pypi]
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
steps:
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1.0.0'
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}'