Skip to content

ENH: Add Stadia Maps image tile server class #20

ENH: Add Stadia Maps image tile server class

ENH: Add Stadia Maps image tile server class #20

Workflow file for this run

name: Build and upload to PyPI
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
# Only build on published releases
on:
release:
types:
- published
jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
outputs:
SDIST_NAME: ${{ steps.sdist.outputs.SDIST_NAME }}
steps:
- uses: actions/checkout@v4
with:
# We need the full history to generate the proper version number
fetch-depth: 0
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.11'
- name: Install dependencies
run: python -m pip install build twine
- name: Build sdist
id: sdist
run: |
python -m build --sdist
# Get the name of the build sdist file for later use
echo "SDIST_NAME=$(ls -1 dist)" >> $GITHUB_OUTPUT
- name: Check README rendering for PyPI
run: twine check dist/*
- name: Upload sdist result
uses: actions/upload-artifact@v3
with:
name: sdist
path: dist/*.tar.gz
if-no-files-found: error
generate-wheels-matrix:
name: Generate wheels matrix
runs-on: ubuntu-latest
outputs:
include: ${{ steps.set-matrix.outputs.include }}
steps:
- uses: actions/checkout@v4
- name: Install cibuildwheel
run: pipx install cibuildwheel==2.14.1
- id: set-matrix
run: |
MATRIX=$(
{
cibuildwheel --print-build-identifiers --platform linux \
| jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \
&& cibuildwheel --print-build-identifiers --platform macos \
| jq -nRc '{"only": inputs, "os": "macos-latest"}' \
&& cibuildwheel --print-build-identifiers --platform windows \
| jq -nRc '{"only": inputs, "os": "windows-2019"}'
} | jq -sc
)
echo "include=$MATRIX" >> $GITHUB_OUTPUT
env:
CIBW_BUILD: "cp39-* cp310-* cp311-*"
# Skip 32 bit windows builds and musllinux due to lack of numpy wheels
CIBW_SKIP: "*-win32 *-musllinux*"
CIBW_ARCHS_MACOS: x86_64 arm64
build_wheels:
name: Build ${{ matrix.os }} ${{ matrix.only }}
needs: [generate-wheels-matrix, build_sdist]
strategy:
matrix:
include: ${{ fromJson(needs.generate-wheels-matrix.outputs.include) }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- name: Download sdist
uses: actions/download-artifact@v3
with:
name: sdist
path: dist
- uses: pypa/cibuildwheel@a873dd9cbf9e3c4c73a1fd11ac31cf835f6eb502 # v2.16.0
with:
only: ${{ matrix.only }}
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
publish:
name: Publish to PyPI
# Only publish on releases
if: github.event_name == 'release'
needs: [build_wheels, build_sdist]
environment:
name: PyPI
url: https://pypi.org/project/cartopy
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
runs-on: ubuntu-latest
steps:
- name: Download wheels
uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Download sdist
uses: actions/download-artifact@v3
with:
name: sdist
path: dist
- name: Publish Package
uses: pypa/[email protected]