1111 # Why building is separate from publishing:
1212 # https://github.com/pypa/gh-action-pypi-publish/issues/217#issuecomment-1965727093
1313 runs-on : ubuntu-latest
14+ outputs :
15+ version : ${{ steps.get-version.outputs.version }}
1416 steps :
1517 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
1618 with :
@@ -21,20 +23,23 @@ jobs:
2123 deps-group : release
2224 - name : Set pre-release version
2325 id : set-version
24- if : ${{ ! startsWith(github.ref, 'refs/tags/') }}
26+ if : startsWith(github.ref, 'refs/tags/') != true
2527 run : |
2628 VERSION_BASE="$(uv version --short)"
2729 RUN_NUMBER="${{ github.run_number }}"
2830 COMMIT_SHA="$(git rev-parse --short HEAD)"
2931 uv version --frozen "${VERSION_BASE}.dev${RUN_NUMBER}+g${COMMIT_SHA}"
32+ - name : Get current version
33+ id : get-version
34+ run : echo "version=$(uv version --short)" >> "$GITHUB_OUTPUT"
3035 - name : Build packages for distribution
3136 run : uv build
3237 - name : Run AppInspect
3338 uses : ./.github/actions/run-appinspect
34- - name : Upload pre-release distributables
39+ - name : Upload distributables
3540 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
3641 with :
37- name : splunk-sdk
42+ name : splunk-sdk-${{ steps.get-version.outputs.version }}
3843 path : dist/
3944 - name : Generate API reference
4045 run : make -C ./docs html
4651
4752 publish-pre-release :
4853 if : startsWith(github.ref, 'refs/tags/') != true
49- needs : build-release
54+ needs : build-distributables
5055 runs-on : ubuntu-latest
5156 permissions :
5257 id-token : write
5762 - name : Download distributables
5863 uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
5964 with :
60- name : splunk-sdk
65+ name : splunk-sdk-${{ needs.build-distributables.outputs.version }}
6166 path : dist/
6267 - name : Publish packages to Test PyPI
6368 uses : pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b
6671
6772 publish-release :
6873 if : startsWith(github.ref, 'refs/tags/')
69- needs : build-release
74+ needs : build-distributables
7075 runs-on : ubuntu-latest
7176 permissions :
7277 id-token : write
7782 - name : Download distributables
7883 uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
7984 with :
80- name : splunk-sdk
85+ name : splunk-sdk-${{ needs.build-distributables.outputs.version }}
8186 path : dist/
8287 - name : Publish packages to PyPI
8388 uses : pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b
0 commit comments