Repository navigation
Release #65
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: Release | |
| on: workflow_dispatch | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| outputs: | |
| released: ${{ steps.semantic_release.outputs.released }} | |
| tag: ${{ steps.semantic_release.outputs.tag }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.head_ref || github.ref_name }} | |
| token: ${{ secrets.GALILEO_AUTOMATION_GITHUB_TOKEN || github.token }} | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Setup UV | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Verify contrib wiring | |
| run: python scripts/contrib_packages.py verify | |
| - name: Python Semantic Release | |
| id: semantic_release | |
| uses: python-semantic-release/python-semantic-release@v10.5.3 | |
| with: | |
| git_committer_name: galileo-automation | |
| git_committer_email: ci@rungalileo.io | |
| github_token: ${{ secrets.GALILEO_AUTOMATION_GITHUB_TOKEN || github.token }} | |
| ssh_public_signing_key: ${{ secrets.GALILEO_AUTOMATION_SSH_PUBLIC_KEY }} | |
| ssh_private_signing_key: ${{ secrets.GALILEO_AUTOMATION_SSH_PRIVATE_KEY }} | |
| root_options: "-vv" | |
| - name: Build Packages | |
| if: steps.semantic_release.outputs.released == 'true' | |
| run: | | |
| uv sync | |
| uv run python scripts/build.py all | |
| - name: Stage built distributions | |
| if: steps.semantic_release.outputs.released == 'true' | |
| run: | | |
| rm -rf release-dists | |
| mkdir -p release-dists/models | |
| mkdir -p release-dists/evaluators/builtin | |
| mkdir -p release-dists/evaluators/contrib | |
| mkdir -p release-dists/pypi/evaluators | |
| mkdir -p release-dists/sdks/python | |
| mkdir -p release-dists/server | |
| cp -R models/dist release-dists/models/ | |
| cp -R evaluators/builtin/dist release-dists/evaluators/builtin/ | |
| cp evaluators/builtin/dist/* release-dists/pypi/evaluators/ | |
| cp -R sdks/python/dist release-dists/sdks/python/ | |
| cp -R server/dist release-dists/server/ | |
| for contrib_dir in evaluators/contrib/*/dist; do | |
| contrib_name="$(basename "$(dirname "$contrib_dir")")" | |
| mkdir -p "release-dists/evaluators/contrib/$contrib_name" | |
| cp -R "$contrib_dir" "release-dists/evaluators/contrib/$contrib_name/" | |
| cp "$contrib_dir"/* release-dists/pypi/evaluators/ | |
| done | |
| - name: Upload built distributions | |
| if: steps.semantic_release.outputs.released == 'true' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-dists | |
| if-no-files-found: error | |
| path: release-dists/ | |
| publish-models: | |
| runs-on: ubuntu-latest | |
| needs: release | |
| if: needs.release.outputs.released == 'true' | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download built distributions | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-dists | |
| path: release-dists | |
| - name: Publish agent-control-models to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: release-dists/models/dist/ | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| publish-evaluators: | |
| runs-on: ubuntu-latest | |
| needs: [release, publish-models] | |
| if: needs.release.outputs.released == 'true' | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download built distributions | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-dists | |
| path: release-dists | |
| - name: Publish evaluator distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: release-dists/pypi/evaluators/ | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| publish-server: | |
| runs-on: ubuntu-latest | |
| needs: [release, publish-evaluators] | |
| if: >- | |
| always() && | |
| needs.release.outputs.released == 'true' && | |
| needs.publish-evaluators.result == 'success' | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download built distributions | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-dists | |
| path: release-dists | |
| - name: Publish agent-control-server to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: release-dists/server/dist/ | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| publish-sdk: | |
| runs-on: ubuntu-latest | |
| needs: [release, publish-evaluators] | |
| if: >- | |
| always() && | |
| needs.release.outputs.released == 'true' && | |
| needs.publish-evaluators.result == 'success' | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download built distributions | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-dists | |
| path: release-dists | |
| - name: Publish agent-control-sdk to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: release-dists/sdks/python/dist/ | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| upload-release-assets: | |
| runs-on: ubuntu-latest | |
| needs: [release, publish-models, publish-evaluators, publish-server, publish-sdk] | |
| if: >- | |
| always() && | |
| needs.release.outputs.released == 'true' | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download built distributions | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-dists | |
| path: release-dists | |
| - name: Upload to GitHub Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GALILEO_AUTOMATION_GITHUB_TOKEN || github.token }} | |
| GH_REPO: ${{ github.repository }} | |
| run: | | |
| shopt -s nullglob | |
| assets=( | |
| release-dists/models/dist/* | |
| release-dists/evaluators/builtin/dist/* | |
| release-dists/sdks/python/dist/* | |
| release-dists/server/dist/* | |
| release-dists/evaluators/contrib/*/dist/* | |
| ) | |
| if [ ${#assets[@]} -eq 0 ]; then | |
| echo "No release assets found" | |
| exit 1 | |
| fi | |
| gh release upload "${{ needs.release.outputs.tag }}" "${assets[@]}" --clobber |