openoutnews 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,67 @@
1
+ name: Deploy
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ jobs:
8
+ test:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+
13
+ - uses: actions/setup-python@v5
14
+ with:
15
+ python-version: "3.12"
16
+
17
+ - uses: astral-sh/setup-uv@v5
18
+
19
+ - name: Install
20
+ run: uv pip install --system -e ".[dev]"
21
+
22
+ - name: Run tests
23
+ run: pytest
24
+
25
+ # The supported install. **Every green push to `main` is a release** — the version is
26
+ # derived here, not committed, because PyPI numbers are single-use and permanent. Same
27
+ # rule as OpenOutFind and OpenOutSend: a release nobody has to remember cannot drift out
28
+ # of sync with what actually shipped. The cost is accepted: every commit that passes CI
29
+ # is public and permanent, so `main` is the release branch and `needs: test` is the whole
30
+ # gate.
31
+ publish-pypi:
32
+ if: github.ref == 'refs/heads/main'
33
+ needs: test
34
+ runs-on: ubuntu-latest
35
+ # Required: the PyPI trusted publisher is registered against this workflow filename
36
+ # *and* this environment name. Do not add a required reviewer to it — that would put
37
+ # every push behind a manual approval, which is the thing this job exists to remove.
38
+ environment: pypi
39
+ permissions:
40
+ id-token: write # PyPI trusted publishing
41
+ steps:
42
+ - uses: actions/checkout@v4
43
+ with:
44
+ fetch-depth: 0 # the version is a commit count; a shallow clone cannot count
45
+
46
+ # `0.1.0` in pyproject.toml is the *base*: major and minor are declared there and
47
+ # bumped by hand when the change deserves it; the patch is how many commits this
48
+ # repo has. Monotonic across a base bump, unique per commit, and nothing has to be
49
+ # committed for it. This repo has no tags, so the count starts at the first commit.
50
+ - name: Derive the version from the commit count
51
+ id: version
52
+ run: |
53
+ set -euo pipefail
54
+ base=$(grep -m1 '^version = ' pyproject.toml | cut -d'"' -f2 | cut -d. -f1,2)
55
+ patch=$(git rev-list --count HEAD)
56
+ version="${base}.${patch}"
57
+ echo "Releasing ${version}"
58
+ sed -i "0,/^version = .*/s//version = \"${version}\"/" pyproject.toml
59
+ echo "value=${version}" >> "$GITHUB_OUTPUT"
60
+
61
+ - name: Build sdist + wheel
62
+ run: pipx run build
63
+
64
+ - name: Publish to PyPI
65
+ uses: pypa/gh-action-pypi-publish@release/v1
66
+ with:
67
+ skip-existing: true # a re-run of an already-published commit is a no-op
@@ -0,0 +1,4 @@
1
+ __pycache__/
2
+ *.pyc
3
+ .venv/
4
+ *.egg-info/