Skip to content

merge: pr #2 from joshua-auchincloss/v0.1.5 #9

merge: pr #2 from joshua-auchincloss/v0.1.5

merge: pr #2 from joshua-auchincloss/v0.1.5 #9

Workflow file for this run

name: build
on:
push:
tags:
- v*
branches:
- master
pull_request:
branches:
- master
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
Validate:
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Hatch
run: pip install --upgrade hatch
- name: Run tests
run: hatch run cov
- name: test-example
run: |
cd example &&
hatch build &&
hatch run cov
Build:
needs: Validate
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/hatch-cython
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch
- name: Build package
run: hatch build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}