Skip to main content
Glama
by mckinsey
release-if-needed.yml4.14 kB
name: Release if needed on: push: branches: - main env: PYTHON_VERSION: "3.13" jobs: check-version: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - name: Set up Python uses: actions/setup-python@v6 with: python-version: ${{ env.PYTHON_VERSION }} - name: Install dependencies run: pip install hatch requests - name: Check which 📦 needs to be released run: python tools/check_package_release.py - name: Set outputs id: version_check run: | echo "new_release=${{ env.NEW_RELEASE }}" >> $GITHUB_OUTPUT echo "package_name=${{ env.PACKAGE_NAME }}" >> $GITHUB_OUTPUT echo "package_version=${{ env.PACKAGE_VERSION }}" >> $GITHUB_OUTPUT outputs: new_release: ${{ steps.version_check.outputs.new_release }} package_name: ${{ steps.version_check.outputs.package_name }} package_version: ${{ steps.version_check.outputs.package_version }} build-publish: needs: [check-version] if: | needs.check-version.outputs.new_release == 'True' runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - name: Set up Python uses: actions/setup-python@v6 with: python-version: ${{ env.PYTHON_VERSION }} - name: Install dependencies run: pip install hatch requests werkzeug>=3.0.1 - name: Extract release notes from ${{needs.check-version.outputs.package_name}}/CHANGELOG.md id: extract run: | formatted_date=$(date +"%Y-%m-%d") python tools/extract_release_notes.py \ "${{needs.check-version.outputs.package_name}}" \ "${{needs.check-version.outputs.package_version}} — $formatted_date" - name: Tag main and create release on github run: | ./tools/release.sh mckinsey vizro ${{ secrets.GITHUB_TOKEN }} \ ${{needs.check-version.outputs.package_name}} \ ${{needs.check-version.outputs.package_version}} release_body.txt - name: Build package run: | cd "${{ needs.check-version.outputs.package_name }}" hatch build - name: Set PyPI token run: | if [ "${{ needs.check-version.outputs.package_name }}" == "vizro-core" ]; then echo 'PYPI_TOKEN=${{ secrets.VIZRO_PYPI_TOKEN }}' >> $GITHUB_ENV elif [ "${{ needs.check-version.outputs.package_name }}" == "vizro-ai" ]; then echo 'PYPI_TOKEN=${{ secrets.VIZRO_AI_PYPI_TOKEN }}' >> $GITHUB_ENV elif [ "${{ needs.check-version.outputs.package_name }}" == "vizro-mcp" ]; then echo 'PYPI_TOKEN=${{ secrets.VIZRO_MCP_PYPI_TOKEN }}' >> $GITHUB_ENV fi - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: packages-dir: ${{ needs.check-version.outputs.package_name }}/dist password: ${{ env.PYPI_TOKEN }} version-bump: needs: [check-version, build-publish] if: | needs.check-version.outputs.new_release == 'True' runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 with: fetch-depth: 0 token: ${{ secrets.VIZRO_SVC_PAT }} - name: Set up Python uses: actions/setup-python@v6 with: python-version: ${{ env.PYTHON_VERSION }} - name: Install dependencies run: pip install hatch # if you want to change this step please contact tech lead - name: Push bumped version to main run: | cd "${{ needs.check-version.outputs.package_name }}" hatch version patch,dev hatch run changelog:add if [ "${{ needs.check-version.outputs.package_name }}" == "vizro-core" ]; then hatch run schema fi git config user.email "145135826+vizro-svc@users.noreply.github.com" git config user.name "Vizro Team" git add -A git commit -m "[Release] Bump ${{needs.check-version.outputs.package_name}} to $(hatch version) [skip ci]" git push origin main

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mckinsey/vizro'

If you have feedback or need assistance with the MCP directory API, please join our Discord server