2.48.0 #58
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
| name: Publish | |
| permissions: | |
| contents: write | |
| attestations: write | |
| pull-requests: write | |
| on: | |
| release: | |
| types: | |
| - published | |
| jobs: | |
| upload_release: | |
| name: Upload release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| environment: secure_publish_environment | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 1 | |
| - uses: actions/setup-python@v4 | |
| name: Install Python | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - name: Releasing tag ${{ github.event.release.tag_name }} | |
| run: | | |
| # Get tag name from event | |
| tag_name="${{ github.event.release.tag_name }}" | |
| if [[ ! "$tag_name" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| cd $(echo $tag_name | rev | cut -d'/' -f2- | rev) | |
| fi | |
| # Install pypa/build | |
| python -m pip install build --user | |
| # Build a binary wheel and a source tarball | |
| python -m build --sdist --wheel --outdir dist/ . | |
| # Publish wheels to PyPI using Trusted Publishers. | |
| # https://docs.pypi.org/trusted-publishers/using-a-publisher/ | |
| # This job needs to run from within the pypi-datadog-checks-base environment. PyPi | |
| # validates the workflow file name, environment and repository the request is | |
| # comming from to provide the valid JWT token. | |
| - name: Release base package to PyPI | |
| uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 | |
| with: | |
| skip-existing: true |