fix: publish verified MARGINAL v0.1.0 source #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |