name: Beta Release (TestPyPI) concurrency: group: beta-release cancel-in-progress: true on: push: branches: - beta paths: - "Server/**" jobs: publish_testpypi: name: Publish beta to TestPyPI runs-on: ubuntu-latest environment: name: testpypi url: https://test.pypi.org/p/mcpforunityserver permissions: contents: read id-token: write steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - name: Install uv uses: astral-sh/setup-uv@v7 with: version: "latest" enable-cache: true cache-dependency-glob: "Server/uv.lock" - name: Generate dev version id: version shell: bash run: | set -euo pipefail BASE_VERSION=$(grep -oP '(?<=version = ")[^"]+' Server/pyproject.toml) # Use date for unique dev version (PEP 440 compliant: X.Y.Z.devN) # Git SHA goes in local version identifier after + DEV_NUMBER="$(date +%Y%m%d%H%M)" GIT_SHA="$(git rev-parse --short HEAD)" DEV_VERSION="${BASE_VERSION}.dev${DEV_NUMBER}+g${GIT_SHA}" echo "Base version: $BASE_VERSION" echo "Dev version: $DEV_VERSION" echo "dev_version=$DEV_VERSION" >> "$GITHUB_OUTPUT" - name: Update version for beta release env: DEV_VERSION: ${{ steps.version.outputs.dev_version }} shell: bash run: | set -euo pipefail sed -i "s/^version = .*/version = \"${DEV_VERSION}\"/" Server/pyproject.toml echo "Updated pyproject.toml:" grep "^version" Server/pyproject.toml - name: Build a binary wheel and a source tarball shell: bash run: uv build working-directory: ./Server - name: Publish distribution to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: packages-dir: Server/dist/ repository-url: https://test.pypi.org/legacy/