Skip to content

fix: publish verified MARGINAL v0.1.0 source #2

fix: publish verified MARGINAL v0.1.0 source

fix: publish verified MARGINAL v0.1.0 source #2

Workflow file for this run

name: Release
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.13"
cache: pip
- run: python -m pip install --upgrade pip
- run: python -m pip install -e ".[dev]"
- run: ruff format --check .
- run: ruff check .
- run: mypy src/marginal
- run: pytest -q
- run: python -m build
- run: python -m twine check dist/*
- name: Create release when the version is new
env:
GH_TOKEN: ${{ github.token }}
run: |
version="$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')"
tag="v${version}"
if gh release view "${tag}" >/dev/null 2>&1; then
echo "Release ${tag} already exists; nothing to publish."
exit 0
fi
gh release create "${tag}" dist/* \
--target "${GITHUB_SHA}" \
--title "MARGINAL ${tag}" \
--generate-notes