Skip to content

Commit

Permalink
update workflow settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ikuyamada committed Jan 12, 2024
1 parent 5b7c85f commit 614e06e
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 150 deletions.
47 changes: 0 additions & 47 deletions .github/workflows/build.yml

This file was deleted.

103 changes: 0 additions & 103 deletions .github/workflows/build_manylinux.yml

This file was deleted.

67 changes: 67 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build and upload to PyPI

on:
workflow_dispatch:
pull_request:
push:
branches:
- master
tags:
- "v*"

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]

steps:
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*"
CIBW_SKIP: "*musllinux*"
CIBW_ARCHS_LINUX: "x86_64 i686"
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_ARCHS_WINDOWS: "AMD64 x86"

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: tests

on: [push]

jobs:
tests:
name: Test
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}

steps:
- name: Check out repo
uses: actions/checkout@v4

- name: Configure Python version
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}

- name: Upgrade pip
run: python -m pip install --upgrade pip

- name: Install package
run: |
pip install -e .
- name: Run tests
run: pytest test_mojimoji.py --junitxml=junit/test-results-${{ matrix.python-version }}.xml

- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.python-version }}
path: junit/test-results-${{ matrix.python-version }}.xml
if: ${{ always() }}

0 comments on commit 614e06e

Please sign in to comment.