| name: Upload Python Package and Docker Image on Release |
| on: |
| release: |
| types: [created] |
|
|
| jobs: |
| pypi-publish: |
| name: Publish release to PyPI |
| runs-on: ubuntu-latest |
| environment: |
| name: pypi |
| url: https://pypi.org/p/openevolve |
| permissions: |
| id-token: write |
| steps: |
| - uses: actions/checkout@v4 |
| - name: Set up Python |
| uses: actions/setup-python@v5 |
| with: |
| python-version: "3.x" |
| - name: Install dependencies |
| run: | |
| python -m pip install --upgrade pip |
| pip install build |
| - name: Build package |
| run: | |
| python -m build |
| - name: Publish package distributions to PyPI |
| uses: pypa/gh-action-pypi-publish@release/v1 |
|
|
| docker-publish: |
| name: Build and publish Docker image |
| runs-on: ubuntu-latest |
| needs: pypi-publish |
| permissions: |
| contents: read |
| packages: write |
| steps: |
| - name: Checkout |
| uses: actions/checkout@v4 |
| |
| - name: Set up QEMU |
| uses: docker/setup-qemu-action@v3 |
| |
| - name: Set up Docker Buildx |
| uses: docker/setup-buildx-action@v3 |
| |
| - name: Log in to GitHub Container Registry |
| uses: docker/login-action@v3 |
| with: |
| registry: ghcr.io |
| username: ${{ github.actor }} |
| password: ${{ secrets.GITHUB_TOKEN }} |
| |
| - name: Extract metadata |
| id: meta |
| uses: docker/metadata-action@v5 |
| with: |
| images: ghcr.io/${{ github.repository }} |
| tags: | |
| type=semver,pattern={{version}} |
| type=semver,pattern={{major}}.{{minor}} |
| type=raw,value=latest |
| labels: | |
| org.opencontainers.image.title=OpenEvolve |
| org.opencontainers.image.description=Open-source evolutionary coding agent |
| org.opencontainers.image.vendor=OpenEvolve |
| org.opencontainers.image.source=https://github.com/${{ github.repository }} |
| org.opencontainers.image.documentation=https://github.com/${{ github.repository }}#readme |
| org.opencontainers.image.licenses=Apache-2.0 |
| |
| - name: Build and push multi-platform Docker image |
| uses: docker/build-push-action@v5 |
| with: |
| context: . |
| platforms: linux/amd64,linux/arm64 |
| push: true |
| tags: ${{ steps.meta.outputs.tags }} |
| labels: ${{ steps.meta.outputs.labels }} |
| cache-from: type=gha,scope=openevolve-multiarch |
| cache-to: type=gha,scope=openevolve-multiarch,mode=max |
| provenance: mode=max |
| sbom: true |