Bump actions/checkout from 6.0.2 to 6.0.3 in the github-actions group… #32
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: Python SDK CD | |
| on: | |
| push: | |
| branches: [develop] | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: false | |
| permissions: {} | |
| jobs: | |
| build-distributables: | |
| name: Build release distributables | |
| # Why building is separate from publishing: | |
| # https://github.com/pypa/gh-action-pypi-publish/issues/217#issuecomment-1965727093 | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.get-version.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 | |
| with: | |
| persist-credentials: false | |
| - uses: ./.github/actions/setup-sdk-environment | |
| with: | |
| python-version: 3.13 | |
| deps-group: release | |
| - name: Set pre-release version | |
| if: startsWith(github.ref, 'refs/tags/') != true | |
| env: | |
| RUN_NUMBER: ${{ github.run_number }} | |
| run: | | |
| VERSION_BASE="$(uv version --short)" | |
| uv version "${VERSION_BASE}.dev${RUN_NUMBER}" | |
| - name: Set release version | |
| if: startsWith(github.ref, 'refs/tags/') == true | |
| env: | |
| VERSION_TAG: ${{ github.event.release.tag_name }} | |
| run: | | |
| [[ ${VERSION_TAG} != $(uv version --short) ]] && { | |
| printf "Git tag should be identical to version field in pyproject.toml" | |
| exit 1 | |
| } | |
| uv version "${VERSION_TAG}" | |
| - name: Get current version | |
| id: get-version | |
| run: echo "version=$(uv version --short)" >> "$GITHUB_OUTPUT" | |
| - name: Build packages for distribution | |
| run: uv build | |
| - name: Run AppInspect | |
| uses: ./.github/actions/run-appinspect | |
| - name: Upload distributables | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: splunk-sdk-${{ steps.get-version.outputs.version }} | |
| path: dist/ | |
| - name: Generate API reference | |
| run: make -C ./docs zip | |
| - name: Upload docs artifact | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: python-sdk-docs | |
| path: docs/_build/splunk-sdk-python-docs.zip | |
| publish-pre-release: | |
| name: Publish pre-release to Test PyPI | |
| if: startsWith(github.ref, 'refs/tags/') == false | |
| needs: build-distributables | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # Required for OIDC-based trusted publishing to PyPI | |
| environment: | |
| name: splunk-test-pypi | |
| url: https://test.pypi.org/project/splunk-sdk/ | |
| steps: | |
| - name: Download distributables | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c | |
| with: | |
| name: splunk-sdk-${{ needs.build-distributables.outputs.version }} | |
| path: dist/ | |
| - name: Publish packages to Test PyPI | |
| uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ | |
| publish-release: | |
| name: Publish release to PyPI | |
| if: startsWith(github.ref, 'refs/tags/') == true | |
| needs: build-distributables | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # Required for OIDC-based trusted publishing to PyPI | |
| environment: | |
| name: splunk-pypi | |
| url: https://pypi.org/project/splunk-sdk/ | |
| steps: | |
| - name: Download distributables | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c | |
| with: | |
| name: splunk-sdk-${{ needs.build-distributables.outputs.version }} | |
| path: dist/ | |
| - name: Publish packages to PyPI | |
| uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b | |
| with: | |
| repository-url: https://upload.pypi.org/legacy/ |