From 05e81c89d594199989013c3d688aef2d367e94d8 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 12 Feb 2026 23:47:15 +0000 Subject: [PATCH] Fix publish-pypi needs bug and add conda-forge publish job - Remove publish-testpypi from publish-pypi needs so manual dispatch with target=pypi no longer gets skipped when testpypi job is skipped - Add publish-conda job that runs after successful PyPI release: uses grayskull to generate recipe from PyPI, builds with conda-build, and uploads to Anaconda using ANACONDA_API_TOKEN secret https://claude.ai/code/session_0131DPae8k2s5bBwPCDiDRUd --- .github/workflows/publish.yml | 42 ++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4399ab5..586b33f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -71,7 +71,7 @@ jobs: publish-pypi: name: Publish to PyPI - needs: [build, publish-testpypi] + needs: build runs-on: ubuntu-latest if: > (github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'pypi') || @@ -91,3 +91,43 @@ jobs: - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 + + publish-conda: + name: Publish to conda-forge + needs: publish-pypi + runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'published' + environment: + name: conda-forge + url: https://anaconda.org/conda-forge/memeplotlib + + steps: + - uses: actions/checkout@v4 + + - name: Set up Miniconda + uses: conda-incubator/setup-miniconda@v3 + with: + python-version: "3.10" + channels: conda-forge,defaults + channel-priority: strict + + - name: Install build tools + run: conda install -y grayskull conda-build anaconda-client + shell: bash -el {0} + + - name: Generate conda recipe from PyPI + run: | + VERSION="${{ github.event.release.tag_name }}" + VERSION="${VERSION#v}" + grayskull pypi "memeplotlib==${VERSION}" + shell: bash -el {0} + + - name: Build conda package + run: conda build memeplotlib/ + shell: bash -el {0} + + - name: Upload to Anaconda + run: | + PACKAGE=$(conda build memeplotlib/ --output) + anaconda -t ${{ secrets.ANACONDA_API_TOKEN }} upload "$PACKAGE" + shell: bash -el {0}