feat: add model serialization with input types and constraint types (… #43
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish | |
| on: | |
| push: | |
| tags: ["v*"] | |
| permissions: | |
| contents: write | |
| id-token: write | |
| jobs: | |
| validate-release: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.extract-version.outputs.tag_version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: extract-version | |
| run: | | |
| TAG_VERSION="${GITHUB_REF#refs/tags/v}" | |
| echo "tag_version=$TAG_VERSION" >> $GITHUB_OUTPUT | |
| - id: read-version | |
| run: | | |
| python3 << EOF | |
| import tomllib | |
| with open('pyproject.toml', 'rb') as f: | |
| data = tomllib.load(f) | |
| version = data['project']['version'] | |
| print(f"pyproject_version={version}", file=open('$GITHUB_OUTPUT', 'a')) | |
| EOF | |
| - run: | | |
| TAG_VERSION="${{ steps.extract-version.outputs.tag_version }}" | |
| PYPROJECT_VERSION="${{ steps.read-version.outputs.pyproject_version }}" | |
| if [ "$TAG_VERSION" != "$PYPROJECT_VERSION" ]; then | |
| echo "Version mismatch: tag=$TAG_VERSION, pyproject=$PYPROJECT_VERSION" | |
| exit 1 | |
| fi | |
| run-ci: | |
| needs: validate-release | |
| uses: ./.github/workflows/ci.yml | |
| secrets: inherit | |
| detect-changes: | |
| needs: run-ci | |
| runs-on: ubuntu-latest | |
| outputs: | |
| packages: ${{ steps.build-matrix.outputs.packages }} | |
| has-changes: ${{ steps.build-matrix.outputs.has-changes }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - id: get-base | |
| run: | | |
| # Get previous tag to compare against (tag pushes don't have github.event.before) | |
| PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "") | |
| if [ -z "$PREVIOUS_TAG" ]; then | |
| echo "base=" >> $GITHUB_OUTPUT | |
| echo "run-all=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "base=$PREVIOUS_TAG" >> $GITHUB_OUTPUT | |
| echo "run-all=false" >> $GITHUB_OUTPUT | |
| fi | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| if: steps.get-base.outputs.run-all != 'true' | |
| with: | |
| base: ${{ steps.get-base.outputs.base }} | |
| filters: | | |
| text-generation: | |
| - 'packages/capabilities/text-generation/**' | |
| - '!**/pyproject.toml' | |
| image-generation: | |
| - 'packages/capabilities/image-generation/**' | |
| - '!**/pyproject.toml' | |
| video-generation: | |
| - 'packages/capabilities/video-generation/**' | |
| - '!**/pyproject.toml' | |
| speech-generation: | |
| - 'packages/capabilities/speech-generation/**' | |
| - '!**/pyproject.toml' | |
| core: | |
| - 'src/celeste/**' | |
| - '!**/pyproject.toml' | |
| - id: build-matrix | |
| run: | | |
| PACKAGES=() | |
| # If first release or paths-filter was skipped, run all | |
| if [[ "${{ steps.get-base.outputs.run-all }}" == "true" ]]; then | |
| PACKAGES=("text-generation" "image-generation" "video-generation" "speech-generation") | |
| else | |
| CORE="${{ steps.filter.outputs.core }}" | |
| if [[ "$CORE" == "true" || "${{ steps.filter.outputs.text-generation }}" == "true" ]]; then | |
| PACKAGES+=("text-generation") | |
| fi | |
| if [[ "$CORE" == "true" || "${{ steps.filter.outputs.image-generation }}" == "true" ]]; then | |
| PACKAGES+=("image-generation") | |
| fi | |
| if [[ "$CORE" == "true" || "${{ steps.filter.outputs.video-generation }}" == "true" ]]; then | |
| PACKAGES+=("video-generation") | |
| fi | |
| if [[ "$CORE" == "true" || "${{ steps.filter.outputs.speech-generation }}" == "true" ]]; then | |
| PACKAGES+=("speech-generation") | |
| fi | |
| fi | |
| # Convert to JSON array | |
| JSON=$(printf '%s\n' "${PACKAGES[@]}" | jq -R . | jq -s -c .) | |
| echo "packages=$JSON" >> $GITHUB_OUTPUT | |
| if [[ ${#PACKAGES[@]} -gt 0 ]]; then | |
| echo "has-changes=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "has-changes=false" >> $GITHUB_OUTPUT | |
| fi | |
| integration-tests: | |
| needs: [validate-release, run-ci, detect-changes] | |
| if: needs.detect-changes.outputs.has-changes == 'true' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| environment: | |
| name: integration-tests | |
| permissions: | |
| contents: read | |
| id-token: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| package: ${{ fromJSON(needs.detect-changes.outputs.packages) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: auth | |
| uses: google-github-actions/auth@v2 | |
| with: | |
| workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} | |
| service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} | |
| - uses: ./.github/actions/setup-python-uv | |
| - name: Run ${{ matrix.package }} integration tests | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| BFL_API_KEY: ${{ secrets.BFL_API_KEY }} | |
| GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | |
| MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }} | |
| COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }} | |
| BYTEPLUS_API_KEY: ${{ secrets.BYTEPLUS_API_KEY }} | |
| XAI_API_KEY: ${{ secrets.XAI_API_KEY }} | |
| ELEVENLABS_API_KEY: ${{ secrets.ELEVENLABS_API_KEY }} | |
| GRADIUM_API_KEY: ${{ secrets.GRADIUM_API_KEY }} | |
| run: uv run pytest packages/capabilities/${{ matrix.package }}/tests/integration_tests/ -m integration -v | |
| build: | |
| needs: [validate-release, run-ci, detect-changes, integration-tests] | |
| if: | | |
| always() && | |
| needs.validate-release.result == 'success' && | |
| needs.run-ci.result == 'success' && | |
| (needs.integration-tests.result == 'success' || needs.integration-tests.result == 'skipped') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - uses: ./.github/actions/setup-python-uv | |
| - run: uv build --all-packages | |
| - run: | | |
| uv pip install twine | |
| uv run twine check dist/* | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| publish-testpypi: | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: testpypi | |
| url: https://test.pypi.org/project/celeste-ai/ | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ | |
| skip-existing: true | |
| print-hash: true | |
| publish-pypi: | |
| needs: [publish-testpypi] | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/project/celeste-ai/ | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| skip-existing: true | |
| print-hash: true | |
| github-release: | |
| needs: [publish-pypi] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - id: extract-version | |
| run: | | |
| TAG_VERSION="${GITHUB_REF#refs/tags/v}" | |
| echo "version=$TAG_VERSION" >> $GITHUB_OUTPUT | |
| - id: changelog | |
| run: | | |
| PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "") | |
| if [ -z "$PREVIOUS_TAG" ]; then | |
| CHANGELOG=$(git log --pretty=format:'- %s' --reverse || echo "Initial release") | |
| else | |
| CHANGELOG=$(git log ${PREVIOUS_TAG}..HEAD --pretty=format:'- %s' || echo "No changes") | |
| fi | |
| { | |
| echo 'changelog<<EOF' | |
| echo "$CHANGELOG" | |
| echo 'EOF' | |
| } >> $GITHUB_OUTPUT | |
| - uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.ref }} | |
| name: Release v${{ steps.extract-version.outputs.version }} | |
| body: | | |
| ## Release v${{ steps.extract-version.outputs.version }} | |
| ### Changes | |
| ${{ steps.changelog.outputs.changelog }} | |
| ### Installation | |
| ```bash | |
| uv add "celeste-ai==${{ steps.extract-version.outputs.version }}" | |
| ``` | |
| files: dist/* | |
| draft: false | |
| prerelease: false |