Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port release workflow from Azure to Actions #271

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Release

on:
pull_request:
push:
tags:
- '*'

jobs:
build_wheels:
name: Wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
if: ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) || contains(github.event.pull_request.labels.*.name, 'Build wheels'))
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install pip "twine>=3.3" -U
python -m pip install "cibuildwheel==2.3.1"
# TODO: Enable py310-* when scipy allows
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: 'cp37-* cp38-* cp39-*'
CIBW_SKIP: '*-musllinux_* *-manylinux_i686'
CIBW_BEFORE_BUILD_LINUX: yum install -y geos-devel freetype-devel libpng-devel
CIBW_TEST_REQUIRES: pytest-astropy
CIBW_TEST_COMMAND: "pytest -p no:warnings --pyargs reproject"
- name: Check wheels
run: python -m twine check --strict wheelhouse/*
# Upload artifacts because gh-action-pypi-publish Docker is only on Linux
- name: Upload wheels
if: startsWith(github.ref, 'refs/tags')
uses: actions/upload-artifact@v2
with:
name: additional-pylons
path: ./wheelhouse/*.whl

build_dist:
runs-on: ubuntu-latest
needs: build_wheels
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install libgeos-dev libfreetype6-dev libpng-dev
python -m pip install pip build "twine>=3.3" -U
- name: Build package
run: python -m build --sdist .
- name: Check dist
run: python -m twine check --strict dist/*
- name: Test package
run: |
cd ..
python -m venv testenv
testenv/bin/pip install pytest-astropy reproject/dist/*.tar.gz
testenv/bin/pytest -p no:warnings --pyargs reproject
- name: Download wheels
if: startsWith(github.ref, 'refs/tags')
uses: actions/download-artifact@v2
with:
name: additional-pylons
path: dist
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
4 changes: 1 addition & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
|Docs| |PyPI| |Build Status| |CI Status| |Coverage Status| |Powered by Astropy Badge|
|Docs| |PyPI| |CI Status| |Coverage Status| |Powered by Astropy Badge|

About
=====
Expand Down Expand Up @@ -26,8 +26,6 @@ https://reproject.readthedocs.io
:target: https://reproject.readthedocs.io/en/latest/?badge=latest
.. |PyPI| image:: https://img.shields.io/pypi/v/reproject.svg
:target: https://pypi.python.org/pypi/reproject
.. |Build Status| image:: https://dev.azure.com/astropy-project/reproject/_apis/build/status/astropy.reproject?branchName=main
:target: https://dev.azure.com/astropy-project/reproject/_build/latest?definitionId=3&branchName=main
.. |CI Status| image:: https://github.com/astropy/reproject/workflows/CI/badge.svg
:target: https://github.com/astropy/reproject/actions
.. |Coverage Status| image:: https://codecov.io/gh/astropy/reproject/branch/main/graph/badge.svg
Expand Down
33 changes: 0 additions & 33 deletions azure-pipelines.yml

This file was deleted.