diff --git a/.github/workflows/build-clients.yml b/.github/workflows/build-clients.yml new file mode 100644 index 00000000..38daf370 --- /dev/null +++ b/.github/workflows/build-clients.yml @@ -0,0 +1,27 @@ +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@v4 + + - uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2 + + - name: Build artifacts + run: uv build --package objectstore-client + + - uses: actions/upload-artifact@v5 + with: + path: dist/* + if-no-files-found: 'error' diff --git a/.github/workflows/release-clients.yml b/.github/workflows/release-clients.yml new file mode 100644 index 00000000..f875499e --- /dev/null +++ b/.github/workflows/release-clients.yml @@ -0,0 +1,44 @@ +name: Release client libraries + +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: + - uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4 + id: token + with: + app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} + private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} + + - uses: actions/checkout@v5 + with: + token: ${{ steps.token.outputs.token }} + fetch-depth: 0 + + - uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2 + + - name: Prepare release + uses: getsentry/action-prepare-release@v1 + env: + GITHUB_TOKEN: ${{ steps.token.outputs.token }} + with: + version: ${{ github.event.inputs.version }} + force: ${{ github.event.inputs.force }} + merge_target: ${{ github.event.inputs.merge_target }} + path: clients diff --git a/clients/.craft.yml b/clients/.craft.yml new file mode 100644 index 00000000..cfc8346a --- /dev/null +++ b/clients/.craft.yml @@ -0,0 +1,13 @@ +changelogPolicy: auto +preReleaseCommand: ../scripts/bump-version-clients.sh + +targets: + - name: github + - name: crates + - name: pypi + - name: sentry-pypi + internalPypiRepo: getsentry/pypi + +requireNames: + - /.*objectstore_client.*whl$/ + - /.*objectstore_client.*tar\.gz$/ diff --git a/clients/CHANGELOG.md b/clients/CHANGELOG.md new file mode 100644 index 00000000..ea012b34 --- /dev/null +++ b/clients/CHANGELOG.md @@ -0,0 +1,3 @@ +# Unreleased + +This is the first release of the Objectstore client SDKs. diff --git a/clients/python/LICENSE.md b/clients/python/LICENSE.md new file mode 120000 index 00000000..f0608a63 --- /dev/null +++ b/clients/python/LICENSE.md @@ -0,0 +1 @@ +../../LICENSE.md \ No newline at end of file diff --git a/clients/python/pyproject.toml b/clients/python/pyproject.toml index ef496bbe..9f455be0 100644 --- a/clients/python/pyproject.toml +++ b/clients/python/pyproject.toml @@ -1,8 +1,14 @@ [project] name = "objectstore-client" version = "0.1.0" -description = "Python client for the Sentry Objectstore service" +description = "Client SDK for Objectstore, the Sentry object storage platform" readme = "README.md" +authors = [ + {name = "Sentry", email = "oss@sentry.io"}, +] +homepage = "https://getsentry.github.io/objectstore/" +repository = "https://github.com/getsentry/objectstore" +license = { file = "LICENSE.md" } requires-python = ">=3.13.1" dependencies = [ "sentry-sdk>=2.42.1", diff --git a/clients/rust/Cargo.toml b/clients/rust/Cargo.toml index 66a04218..6ea1915a 100644 --- a/clients/rust/Cargo.toml +++ b/clients/rust/Cargo.toml @@ -4,7 +4,7 @@ authors = ["Sentry "] description = "Client SDK for Objectstore, the Sentry object storage platform" homepage = "https://getsentry.github.io/objectstore/" repository = "https://github.com/getsentry/objectstore" -license-file = "../LICENSE.md" +license-file = "../../LICENSE.md" version = "0.1.0" edition = "2024" rust-version = "1.89" diff --git a/scripts/bump-version-clients.sh b/scripts/bump-version-clients.sh new file mode 100755 index 00000000..d4cd2a8a --- /dev/null +++ b/scripts/bump-version-clients.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -euxo pipefail + +ROOT_DIR="$(realpath $(dirname "$0")/..)" + +OLD_VERSION="${1}" +NEW_VERSION="${2}" + +echo "Current version: $OLD_VERSION" +echo "Bumping to version: $NEW_VERSION" + +# =================== Rust =================== + +cd $ROOT_DIR +cd clients/rust + +perl -pi -e "s/^version = \".*?\"/version = \"$NEW_VERSION\"/" Cargo.toml +cargo metadata --format-version 1 >/dev/null # update `Cargo.lock` + +# ==================== PY ==================== + +cd $ROOT_DIR +cd clients/python + +uv version "$NEW_VERSION"