Release v1.1.0 #2
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 Release (PyPI + Conda) | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| # Build source distribution (sdist) - only once, platform-independent | |
| build-sdist: | |
| name: Build Source Distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install build dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build wheel setuptools | |
| - name: Build source distribution only | |
| run: python -m build --sdist | |
| - name: Upload sdist artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pypi-sdist | |
| path: dist/*.tar.gz | |
| retention-days: 7 | |
| # Build binary wheels for each platform/Python version | |
| build-wheels: | |
| name: Build Wheels | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build wheels | |
| uses: pypa/[email protected] | |
| # Configuration is in pyproject.toml under [tool.cibuildwheel] | |
| - name: Upload wheel artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pypi-wheel-${{ matrix.os }} | |
| path: wheelhouse/*.whl | |
| retention-days: 7 | |
| # Build Conda packages | |
| build-conda: | |
| if: false # Disabled: conda workflow doesn't work yet | |
| name: Build Conda Package | |
| runs-on: ${{ matrix.os }} | |
| continue-on-error: true # Allow conda builds to fail without blocking PyPI release | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-15-intel] # Intel runner for conda compatibility | |
| python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | |
| # Note: Excluded Python 3.13+ due to conda-build virtual package resolution issues | |
| # Note: Using macos-15-intel (x86_64) for consistency with conda-forge practices | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Conda | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| channels: conda-forge | |
| channel-priority: strict | |
| activate-environment: build-env | |
| - name: Install conda-build and anaconda-client | |
| shell: bash -l {0} | |
| run: | | |
| # Use classic solver to avoid libmamba compatibility issues | |
| conda config --set solver classic | |
| conda install -y conda-build anaconda-client | |
| - name: Build conda package | |
| shell: bash -l {0} | |
| run: | | |
| conda build conda.recipe --output-folder ./conda-bld | |
| - name: Upload Conda artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: conda-package-${{ matrix.os }}-py${{ matrix.python-version }} | |
| path: ./conda-bld/**/*.tar.bz2 | |
| retention-days: 7 | |
| # Publish to PyPI | |
| publish-pypi: | |
| name: Publish to PyPI | |
| needs: [build-sdist, build-wheels] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download all PyPI artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: pypi-* | |
| merge-multiple: true | |
| path: dist/ | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| # Publish to Anaconda Cloud | |
| publish-conda: | |
| if: false # Disabled: conda workflow doesn't work yet | |
| name: Publish to Anaconda Cloud | |
| needs: build-conda | |
| runs-on: ubuntu-latest | |
| # if: success() # Only run if conda builds succeeded | |
| steps: | |
| - name: Set up Conda | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| python-version: '3.11' | |
| channels: conda-forge | |
| - name: Install anaconda-client | |
| shell: bash -l {0} | |
| run: | | |
| conda install -y anaconda-client | |
| - name: Download Conda artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: conda-package-* | |
| merge-multiple: true | |
| path: ./conda-packages | |
| - name: Upload to Anaconda Cloud | |
| shell: bash -l {0} | |
| env: | |
| ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }} | |
| run: | | |
| anaconda -t $ANACONDA_API_TOKEN upload ./conda-packages/**/*.tar.bz2 --force --label main | |
| # Create release summary | |
| release-summary: | |
| name: Release Summary | |
| needs: [publish-pypi] | |
| runs-on: ubuntu-latest | |
| if: always() # Run even if conda publish fails | |
| steps: | |
| - name: Create summary | |
| run: | | |
| echo "## 🎉 Release Published!" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Installation" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**Via pip (PyPI):**" >> $GITHUB_STEP_SUMMARY | |
| echo '```bash' >> $GITHUB_STEP_SUMMARY | |
| echo "pip install slick-queue-py" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Links" >> $GITHUB_STEP_SUMMARY | |
| echo "- PyPI: https://pypi.org/project/slick-queue-py/" >> $GITHUB_STEP_SUMMARY |