66 types: [published]
77 workflow_dispatch:
88
9+ concurrency:
10+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+ cancel-in-progress: false
12+
13+ permissions: {}
14+
915env:
1016 DIST_DIR: dist/
1117
1218jobs:
1319 build-distributables:
20+ name: Build distributables
1421 # Why building is separate from publishing:
1522 # https://github.com/pypa/gh-action-pypi-publish/issues/217#issuecomment-1965727093
1623 runs-on: ubuntu-latest
@@ -26,15 +33,17 @@ jobs:
2633 deps-group: release
2734 - name: Set pre-release version
2835 if: startsWith(github.ref, 'refs/tags/') != true
36+ env:
37+ RUN_NUMBER: ${{ github.run_number }}
2938 run: |
3039 VERSION_BASE="$(uv version --short)"
31- RUN_NUMBER="${{ github.run_number }}"
3240 uv version "${VERSION_BASE}.dev${RUN_NUMBER}"
3341 - name: Set release version
3442 if: startsWith(github.ref, 'refs/tags/') == true
43+ env:
44+ VERSION_TAG: ${{ github.event.release.tag_name }}
3545 run: |
36- VERSION_TAG="${{ github.event.release.tag_name }}"
37- [[ $VERSION_TAG != $(uv version --short) ]] && {
46+ [[ ${VERSION_TAG} != $(uv version --short) ]] && {
3847 printf "Git tag should be identical to version field in pyproject.toml"
3948 exit 1
4049 }
@@ -60,11 +69,12 @@ jobs:
6069 path: docs/_build/html
6170
6271 publish-pre-release:
72+ name: Publish pre-release to Test PyPI
6373 if: startsWith(github.ref, 'refs/tags/') == false
6474 needs: build-distributables
6575 runs-on: ubuntu-latest
6676 permissions:
67- id-token: write
77+ id-token: write # Required for OIDC-based trusted publishing to PyPI
6878 environment:
6979 name: splunk-test-pypi
7080 url: https://test.pypi.org/project/splunk-sdk/
@@ -80,11 +90,12 @@ jobs:
8090 repository-url: https://test.pypi.org/legacy/
8191
8292 publish-release:
93+ name: Publish release to PyPI
8394 if: startsWith(github.ref, 'refs/tags/') == true
8495 needs: build-distributables
8596 runs-on: ubuntu-latest
8697 permissions:
87- id-token: write
98+ id-token: write # Required for OIDC-based trusted publishing to PyPI
8899 environment:
89100 name: splunk-pypi
90101 url: https://pypi.org/project/splunk-sdk/
0 commit comments