Skip to content

Release

Release #3

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to release (e.g., v4.2.0)'
required: true
type: string
jobs:
extract-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
version_number: ${{ steps.version.outputs.version_number }}
steps:
- name: Extract version from tag
id: version
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
VERSION=${{ inputs.tag }}
else
VERSION=${GITHUB_REF#refs/tags/}
fi
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "version_number=${VERSION#v}" >> $GITHUB_OUTPUT
build-wheels:
needs: [extract-version]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, macos-15-intel]
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
- name: Install cibuildwheel
run: |
python -m pip install --upgrade pip
pip install cibuildwheel
- name: Build wheels
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_BEFORE_BUILD: "pip install uv && uv sync --frozen --no-dev || uv sync --no-dev"
run: |
cibuildwheel --output-dir wheelhouse
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: wheelhouse/*.whl
retention-days: 7
build-sdist:
needs: [extract-version]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Build sdist
run: |
uv build --sdist
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
retention-days: 7
release:
needs:
- extract-version
- build-wheels
- build-sdist
runs-on: ubuntu-latest
permissions:
contents: write
if: github.event_name == 'push'
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: dist-all
- name: Combine artifacts
run: |
mkdir -p dist
# Copy all wheels
find dist-all -name "*.whl" -exec cp {} dist/ \;
# Copy sdist (should be only one)
find dist-all -name "*.tar.gz" -exec cp {} dist/ \;
echo "Artifacts in dist/:"
ls -lh dist/
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.extract-version.outputs.version }}
name: Release ${{ needs.extract-version.outputs.version }}
body: |
## Python Mapnik ${{ needs.extract-version.outputs.version_number }}
### Installation
Download the wheel file for your platform and install:
```bash
pip install mapnik-${{ needs.extract-version.outputs.version_number }}-*.whl
```
Or install directly from GitHub (replace platform tag as needed):
```bash
pip install https://github.com/${{ github.repository }}/releases/download/${{ needs.extract-version.outputs.version }}/mapnik-${{ needs.extract-version.outputs.version_number }}-cp312-cp312-linux_x86_64.whl
```
Or install from source:
```bash
pip install git+https://github.com/${{ github.repository }}.git@${{ needs.extract-version.outputs.version }}
```
### Requirements
- Python >= 3.12
- Mapnik >= 4.2.0
### Changes
See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/${{ needs.extract-version.outputs.version }}/CHANGELOG.md) for details.
files: |
dist/*.whl
dist/*.tar.gz
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Summary
run: |
echo "## Release Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "✅ Released version: **${{ needs.extract-version.outputs.version }}**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Artifacts Built:" >> $GITHUB_STEP_SUMMARY
ls -lh dist/ >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Supported Platforms:" >> $GITHUB_STEP_SUMMARY
echo "- Linux x86_64: ✅" >> $GITHUB_STEP_SUMMARY
echo "- Linux arm64: ✅" >> $GITHUB_STEP_SUMMARY
echo "- macOS x86_64: ✅" >> $GITHUB_STEP_SUMMARY
echo "- macOS arm64: ✅" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Distribution:" >> $GITHUB_STEP_SUMMARY
echo "- GitHub Release: ✅" >> $GITHUB_STEP_SUMMARY