mirror of
https://github.com/shadoll/moma.git
synced 2026-08-28 03:27:34 +00:00
feat: Add CI and Release workflows for automated testing and publishing; update documentation in AGENTS.md, CHANGELOG.md, DEVELOP.md, and INSTALL.md
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test (Python ${{ matrix.python-version }})
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.11", "3.12"]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
version: "latest"
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Install system dependencies
|
||||
run: sudo apt-get install -y libmediainfo-dev
|
||||
|
||||
- name: Install dependencies
|
||||
run: uv sync --extra dev
|
||||
|
||||
- name: Run tests
|
||||
run: uv run pytest
|
||||
|
||||
- name: Type check
|
||||
run: uv run mypy src/ --ignore-missing-imports
|
||||
@@ -0,0 +1,80 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*.*.*"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build-and-release:
|
||||
name: Build and publish release
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
version: "latest"
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Install system dependencies
|
||||
run: sudo apt-get install -y libmediainfo-dev
|
||||
|
||||
- name: Install dependencies
|
||||
run: uv sync --extra dev
|
||||
|
||||
- name: Run tests
|
||||
run: uv run pytest
|
||||
|
||||
- name: Build distribution
|
||||
run: uv build
|
||||
|
||||
- name: Extract version from tag
|
||||
id: version
|
||||
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Create short-name and latest aliases
|
||||
run: |
|
||||
cp dist/moma-${{ steps.version.outputs.version }}-py3-none-any.whl dist/moma-${{ steps.version.outputs.version }}.whl
|
||||
cp dist/moma-${{ steps.version.outputs.version }}-py3-none-any.whl dist/moma-latest.whl
|
||||
cp dist/moma-${{ steps.version.outputs.version }}.tar.gz dist/moma-latest.tar.gz
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
name: "moma v${{ steps.version.outputs.version }}"
|
||||
tag_name: ${{ github.ref_name }}
|
||||
body: |
|
||||
## moma v${{ steps.version.outputs.version }}
|
||||
|
||||
See [CHANGELOG.md](https://github.com/shadoll/moma/blob/main/CHANGELOG.md) for details.
|
||||
|
||||
### Install
|
||||
|
||||
```bash
|
||||
# With uv — always latest
|
||||
uv tool install https://github.com/shadoll/moma/releases/latest/download/moma-latest.whl
|
||||
|
||||
# With uv — specific version
|
||||
uv tool install https://github.com/shadoll/moma/releases/download/${{ github.ref_name }}/moma-${{ steps.version.outputs.version }}.whl
|
||||
|
||||
# With pip
|
||||
pip install https://github.com/shadoll/moma/releases/download/${{ github.ref_name }}/moma-${{ steps.version.outputs.version }}.whl
|
||||
```
|
||||
files: |
|
||||
dist/moma-${{ steps.version.outputs.version }}.whl
|
||||
dist/moma-${{ steps.version.outputs.version }}.tar.gz
|
||||
dist/moma-latest.whl
|
||||
dist/moma-latest.tar.gz
|
||||
draft: false
|
||||
prerelease: false
|
||||
Reference in New Issue
Block a user