Skip to content

gwy: handling uuid conversion errors #2

gwy: handling uuid conversion errors

gwy: handling uuid conversion errors #2

# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
name: sdk-build-and-publish
on:
workflow_dispatch: # Manually trigger the workflow from the Actions tab
# a release is created automatically after the tag is pushed
push:
paths:
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
- sdk/**
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # this excludes tags like v1.0.0-rc1 or v1.0.0-beta1
permissions:
id-token: "write"
contents: "write"
packages: "write"
pull-requests: "read"
jobs:
sdk-uv-build:
strategy:
matrix:
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
name: sdk-uv-build
steps:
# https://github.com/actions/checkout
- name: Checkout code
uses: actions/checkout@v4
# https://github.com/actions/setup-python
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.x"
# https://github.com/astral-sh/setup-uv
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
# The version of uv to install
version: latest # optional, default is latest
# The checksum of the uv version to install
# checksum: # optional
# Used to increase the rate limit when retrieving versions and downloading uv.
github-token: ${{ github.token }} # optional, default is ${{ github.token }}
# Enable caching of the uv cache
enable-cache: false # optional, default is false
# Glob pattern to match files relative to the repository root to control the cache.
# cache-dependency-glob: # optional, default is **/uv.lock
# Suffix for the cache key
# cache-suffix: # optional
# Local path to store the cache.
# cache-local-path: # optional
# Custom path to set UV_TOOL_DIR to.
# tool-dir: # optional
# Custom path to set UV_TOOL_BIN_DIR to.
# tool-bin-dir: # optional
- name: Install just on ubuntu
if: matrix.platform == 'ubuntu-latest'
working-directory: ./sdk
run: |
npm install -g rust-just
- name: Install dependencies for testing
working-directory: ./sdk
run: uv sync --frozen --link-mode=copy --dev
- name: Check missing or unused dependencies with deptry
working-directory: ./sdk
run: uv run deptry .
- name: Test package
# test everything, as we don't know if the
# sdk-checks ran on this commit being released
working-directory: ./sdk
run: just test-all
- name: Install dependencies for releasing
working-directory: ./sdk
run: uv sync --frozen --link-mode=copy --no-dev
- name: Build package
working-directory: ./sdk
run: uv build --link-mode=copy
- name: Listing packaged files
working-directory: ./sdk
run: tar -tvf dist/*.tar.gz | sort -k6
- name: Build acceptance checks
# checks the actual package built, to catch errors in the build
# configuration and make sure the published package is usable
working-directory: ./sdk
run: uv run --isolated --no-project -p 3.13 --with dist/*.tar.gz tests/e2e_examples/check_build_acceptance.py
- name: Store artifact
# https://github.com/actions/upload-artifact?tab=readme-ov-file#inputs
uses: actions/upload-artifact@main
with:
name: dist
path: ./sdk/dist
if-no-files-found: error
sdk-github-release:
runs-on: ubuntu-latest
name: sdk-github-release
needs: [sdk-uv-build]
steps:
- name: Download artifact for GH release
# https://github.com/actions/download-artifact?tab=readme-ov-file#inputs
uses: actions/download-artifact@main
with:
name: dist
path: ./sdk/dist
- name: Automatic GitHub release
# https://github.com/marketplace/actions/automatic-releases
# generates a `@latest` release on github with automatic changelog
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
sdk/dist/*.tar.gz
sdk/dist/*.whl
sdk-pypi-release:
runs-on: ubuntu-latest
name: sdk-pypi-release
needs: [sdk-uv-build]
environment: pypi
permissions:
# A 'write' permission is mandatory for trusted publishing
id-token: write
steps:
- name: Download artifact for PyPI deploy
# https://github.com/actions/download-artifact?tab=readme-ov-file#inputs
uses: actions/download-artifact@main
with:
name: dist
path: ./sdk/dist
# https://github.com/astral-sh/setup-uv
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: latest # optional, default is latest
# used to increase the rate limit when retrieving versions and downloading uv.
github-token: ${{ github.token }} # optional, default is ${{ github.token }}
enable-cache: false # optional, default is false
- name: Publish package
run: uv publish --trusted-publishing always
working-directory: ./sdk