Adjust pre-release.yml to set the version before uploading to Test PyPI #4
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 pre-release to Test PyPI | |
| on: [ push ] | |
| # push: | |
| # branches: | |
| # - develop | |
| # - release/2.x | |
| # workflow_dispatch: | |
| env: | |
| PYTHON_VERSION: 3.13 | |
| MOCK_APP_PATH: ./tests/system/test_apps/generating_app | |
| jobs: | |
| publish-pre-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| environment: | |
| name: splunk-test-pypi | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - uses: ./.github/actions/setup-sdk-environment | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| deps-group: release | |
| - name: Set pre-release version | |
| env: | |
| RUN_NUMBER: ${{ github.run_number }} | |
| run: | | |
| SHA=$(git rev-parse --short HEAD) | |
| BASE=$(uv version --short) | |
| uv version --frozen "${BASE}.dev${RUN_NUMBER}+g${SHA}" | |
| - name: Build packages for distribution | |
| run: uv build | |
| - name: Install splunk-appinspect dependencies | |
| run: sudo apt-get install -y libmagic1 | |
| - name: Install packages for the mock app | |
| run: | | |
| mkdir -p ${{ env.MOCK_APP_PATH }}/bin/lib | |
| uv pip install ".[openai, anthropic]" --target ${{ env.MOCK_APP_PATH }}/bin/lib | |
| - name: Copy splunklib to a test app and package it as a mock app | |
| run: | | |
| cd ${{ env.MOCK_APP_PATH }} | |
| tar -czf mock_app.tgz --exclude="__pycache__" bin default metadata | |
| - name: Validate mock app with splunk-appinspect | |
| run: uvx splunk-appinspect inspect ${{ env.MOCK_APP_PATH }}/mock_app.tgz | |
| --included-tags cloud | |
| # - name: Publish packages to Test PyPI | |
| # uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b | |
| # with: | |
| # repository-url: https://test.pypi.org/legacy/ |