Skip to content

Commit

Permalink
use new workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
K0lb3 committed Mar 7, 2025
1 parent 7c4284a commit c80e5ec
Show file tree
Hide file tree
Showing 4 changed files with 231 additions and 91 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# clone of: https://github.com/mitmproxy/pdoc/blob/main/.github/workflows/docs.yml
name: texture2ddecoder docs

# build the documentation whenever there are new commits on main
on:
push:
branches:
- main
# Alternative: only build for tags.
# tags:
# - '*'

# security: restrict permissions for CI jobs.
permissions:
contents: read

jobs:
# Build the documentation and upload the static HTML files as an artifact.
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install local package
run: pip install -e .

- name: Install pdoc
run: pip install pdoc pillow

# ADJUST THIS: build your documentation into docs/.
# We use a custom build script for pdoc itself, ideally you just run `pdoc -o docs/ ...` here.
- run: pdoc --docformat numpy -o docs/ ./texture2ddecoder

- uses: actions/upload-pages-artifact@v3
with:
path: docs/

# Deploy the artifact to GitHub pages.
# This is a separate job so that only actions/deploy-pages has the necessary permissions.
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
91 changes: 0 additions & 91 deletions .github/workflows/python-package.yml

This file was deleted.

145 changes: 145 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: Build & Publish wheels
on:
workflow_dispatch


jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

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

- name: Install sdist
run: pip install dist/*.tar.gz

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

build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
environment: release
strategy:
fail-fast: true
matrix:
os: [windows-latest, macos-latest]

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Build wheels
uses: joerick/[email protected]
env:
CIBW_TEST_SKIP: "*"

- uses: actions/upload-artifact@v4
with:
name: "${{ matrix.os }}"
path: ./wheelhouse/*.whl
retention-days: 1

build_wheels_ubuntu_manylinux:
name: Build x86 manylinux wheels on ubuntu-latest
runs-on: ubuntu-latest
environment: release

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Build wheels
uses: joerick/[email protected]
env:
CIBW_SKIP: "*aarch64 *ppc64le *s390x *armv7l *-musllinux*"
CIBW_TEST_SKIP: "*"

- uses: actions/upload-artifact@v4
with:
name: "ubuntu-latest-manylinux"
path: ./wheelhouse/*.whl
retention-days: 1

build_wheels_ubuntu_musllinux:
name: Build x86 musllinux wheels on ubuntu-latest
runs-on: ubuntu-latest
environment: release

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Build wheels
uses: joerick/[email protected]
env:
CIBW_SKIP: "*aarch64 *ppc64le *s390x *armv7l *-manylinux*"
CIBW_TEST_SKIP: "*"

- uses: actions/upload-artifact@v4
with:
name: "ubuntu-latest-musllinux"
path: ./wheelhouse/*.whl
retention-days: 1

build_wheels_qemu:
name: Build wheels qemu on ubuntu-latest
runs-on: ubuntu-latest
environment: release

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Build wheels
uses: joerick/[email protected]
env:
CIBW_SKIP: "*x86_64 *i686"
CIBW_TEST_SKIP: "*"

- uses: actions/upload-artifact@v4
with:
name: "ubuntu-latest-qemu"
path: ./wheelhouse/*.whl
retention-days: 1


upload_pypi:
name: Publish to PyPI
needs: [build_wheels, build_wheels_qemu, build_wheels_ubuntu_manylinux, build_wheels_ubuntu_musllinux, build_sdist]
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test
on:
push

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

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v5
if: matrix.os == 'ubuntu-latest'
with:
python-version: '3.x'

- name: Install
run: pip install .[tests]

- name: Run tests
run: pytest -vs ./tests

0 comments on commit c80e5ec

Please sign in to comment.