From 56da5bc8862cd2fbb458b049c0642c3ccac0ac7a Mon Sep 17 00:00:00 2001 From: Mark Story Date: Wed, 4 Feb 2026 12:26:38 -0800 Subject: [PATCH 1/2] feat: Add workflow and craft tooling for client libs Add a github-action workflow and `.craft.yml` configuration for releasing client libraries to pypi and our internal pypi. Refs STREAM-717 --- .github/workflows/release-client.yml | 40 ++++++++++++++++++++++++++++ clients/.craft.yml | 12 +++++++++ clients/CHANGELOG.md | 1 + scripts/bump-version-clients.sh | 9 +++++++ 4 files changed, 62 insertions(+) create mode 100644 .github/workflows/release-client.yml create mode 100644 clients/.craft.yml create mode 100644 clients/CHANGELOG.md create mode 100755 scripts/bump-version-clients.sh diff --git a/.github/workflows/release-client.yml b/.github/workflows/release-client.yml new file mode 100644 index 00000000..f9c7d544 --- /dev/null +++ b/.github/workflows/release-client.yml @@ -0,0 +1,40 @@ +on: + workflow_dispatch: + inputs: + version: + description: Version to release + required: true + force: + description: Force a release even when there are release-blockers (optional) + required: false + merge_target: + description: Target branch to merge into. Uses the default branch as a fallback (optional) + required: false + +permissions: + contents: read + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Get auth token + id: token + uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 + with: + app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} + private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} + + - uses: actions/checkout@v4 + with: + token: ${{ steps.token.outputs.token }} + fetch-depth: 0 + + - name: Prepare release + uses: getsentry/craft@c6e2f04939b6ee67030588afbb5af76b127d8203 # v2 + env: + GITHUB_TOKEN: ${{ steps.token.outputs.token }} + with: + version: ${{ github.event.inputs.version }} + force: ${{ github.event.inputs.force }} + path: clients diff --git a/clients/.craft.yml b/clients/.craft.yml new file mode 100644 index 00000000..62b573ba --- /dev/null +++ b/clients/.craft.yml @@ -0,0 +1,12 @@ +changelogPolicy: auto +preReleaseCommand: ../scripts/bump-version-clients.sh + +targets: + - name: github + - name: pypi + - name: sentry-pypi + internalPypiRepo: getsentry/pypi + +requireNames: + - /.*taskbroker_client.*whl$/ + - /.*taskbroker_client.*tar\.gz$/ diff --git a/clients/CHANGELOG.md b/clients/CHANGELOG.md new file mode 100644 index 00000000..825c32f0 --- /dev/null +++ b/clients/CHANGELOG.md @@ -0,0 +1 @@ +# Changelog diff --git a/scripts/bump-version-clients.sh b/scripts/bump-version-clients.sh new file mode 100755 index 00000000..b5f73a13 --- /dev/null +++ b/scripts/bump-version-clients.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -euo pipefail + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +ROOT_DIR=$(dirname $SCRIPT_DIR) + +cd $ROOT_DIR/clients/python + +uv version "${NEW_VERSION}" From 8106ea50956305bbd0c03504c84ab1e93cd1a844 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Wed, 4 Feb 2026 12:34:49 -0800 Subject: [PATCH 2/2] Add artifact build workflow. --- .github/workflows/build-client.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/build-client.yml diff --git a/.github/workflows/build-client.yml b/.github/workflows/build-client.yml new file mode 100644 index 00000000..61124197 --- /dev/null +++ b/.github/workflows/build-client.yml @@ -0,0 +1,28 @@ +name: Build Python client + +on: + push: + branches: + - release/** + +permissions: + contents: read + +jobs: + build: + name: Build and upload artifacts + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + + - uses: astral-sh/setup-uv@5a7eac68fb9809dea845d802897dc5c723910fa3 # v7.1.3 + + - name: Build artifacts + run: uv build --package taskbroker-client + + - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + with: + name: ${{ github.sha }} + path: dist/* + if-no-files-found: 'error'