From f2d4b39d257072ac6e1ffb5115bbefab1c7fde9e Mon Sep 17 00:00:00 2001 From: David Sarno Date: Sun, 25 Jan 2026 17:53:50 -0800 Subject: [PATCH] feat: add beta release workflow for TestPyPI Publishes dev versions to TestPyPI when Server/ changes are pushed to beta. Only triggers when there are actual changes to avoid wasted cycles. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/beta-release.yml | 68 ++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/beta-release.yml diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml new file mode 100644 index 0000000..9a213ec --- /dev/null +++ b/.github/workflows/beta-release.yml @@ -0,0 +1,68 @@ +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 + short SHA for unique dev version + DEV_SUFFIX="dev$(date +%Y%m%d%H%M).g$(git rev-parse --short HEAD)" + DEV_VERSION="${BASE_VERSION}.${DEV_SUFFIX}" + 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/