send: outsend send N sleeps through the spacing clock to open N this … #7
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: Deploy | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - uses: astral-sh/setup-uv@v5 | |
| - name: Install | |
| run: uv pip install --system -e ".[dev]" | |
| - name: Run tests | |
| run: pytest | |
| # The supported install. **Every green push to `main` is a release** — the version is | |
| # derived here, not committed, because PyPI numbers are single-use and permanent. | |
| # | |
| # This is the finder's rule, and it is here for the reason it went there: `0.1.0` was | |
| # tagged by hand on that side, twelve commits landed behind it, and `uvx openoutreach` | |
| # kept serving the version from before all of them. A release nobody has to remember | |
| # cannot drift. The cost is accepted: every commit that passes CI is public and | |
| # permanent, so `main` is the release branch and `needs: test` is the whole gate. | |
| publish-pypi: | |
| if: github.ref == 'refs/heads/main' | |
| needs: test | |
| runs-on: ubuntu-latest | |
| # Required: the PyPI trusted publisher is registered against this workflow filename | |
| # *and* this environment name. Do not add a required reviewer to it — that would put | |
| # every push behind a manual approval, which is the thing this job exists to remove. | |
| environment: pypi | |
| permissions: | |
| id-token: write # PyPI trusted publishing | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # the version is a commit count; a shallow clone cannot count | |
| # `0.1.0` in pyproject.toml is the *base*: major and minor are declared there and | |
| # bumped by hand when the change deserves it; the patch is how many commits this | |
| # repo has. Monotonic across a base bump (0.1.20 → 0.2.21), unique per commit, and | |
| # nothing has to be committed for it. The finder counts from its `v0.1.0` tag; this | |
| # repo has no tags, so the count starts at the first commit. | |
| - name: Derive the version from the commit count | |
| id: version | |
| run: | | |
| set -euo pipefail | |
| base=$(grep -m1 '^version = ' pyproject.toml | cut -d'"' -f2 | cut -d. -f1,2) | |
| patch=$(git rev-list --count HEAD) | |
| version="${base}.${patch}" | |
| echo "Releasing ${version}" | |
| sed -i "0,/^version = .*/s//version = \"${version}\"/" pyproject.toml | |
| echo "value=${version}" >> "$GITHUB_OUTPUT" | |
| - name: Build sdist + wheel | |
| run: pipx run build | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| skip-existing: true # a re-run of an already-published commit is a no-op |