Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 42 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
TOOL_PYTHON_VERSION: "3.11"
COVERAGE_PYTHON: "3.14"
HATCH_VERSION: "1.18.2"
UV_VERSION: "0.13.8"
UV_VERSION: "0.13.9"
DISTRIBUTION_NAME: "rocheometry"
IMPORT_NAME: "rocheometry"
DOCS_ENABLED: "true"
Expand Down Expand Up @@ -430,6 +430,32 @@ jobs:
exit 1
fi

- name: Extract release notes
if: github.ref_type == 'tag'
run: |
mkdir -p release-notes
awk -v heading="## [$GITHUB_REF_NAME]" '
index($0, heading) == 1 { found = 1; next }
found && (/^## / || /^\[[^]]+\]: /) { exit }
found
' docs/CHANGELOG.md > release-notes/notes.md
if ! grep -q '[^[:space:]]' release-notes/notes.md; then
echo "docs/CHANGELOG.md has no '## [$GITHUB_REF_NAME]' section" >&2
exit 1
fi
cat >> release-notes/notes.md <<EOF

---

Install from [PyPI](https://pypi.org/project/$DISTRIBUTION_NAME/$GITHUB_REF_NAME/):

\`\`\`shell
python -m pip install $DISTRIBUTION_NAME==$GITHUB_REF_NAME
\`\`\`

See the [full changelog](https://github.com/$GITHUB_REPOSITORY/blob/$GITHUB_REF_NAME/docs/CHANGELOG.md).
EOF

- name: Build
run: hatch build

Expand Down Expand Up @@ -467,6 +493,13 @@ jobs:
name: dist
path: dist/

- name: Upload release notes
if: github.ref_type == 'tag'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: release-notes
path: release-notes/

ci-gate:
name: CI gate
if: ${{ always() && (github.event_name != 'push' || github.ref_type != 'tag') }}
Expand Down Expand Up @@ -533,11 +566,18 @@ jobs:
name: dist
path: dist/

- name: Download release notes
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: release-notes
path: release-notes/

- name: Create release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
gh release create "$GITHUB_REF_NAME" dist/* \
--generate-notes \
--title "$DISTRIBUTION_NAME $GITHUB_REF_NAME" \
--notes-file release-notes/notes.md \
--verify-tag
2 changes: 1 addition & 1 deletion .github/workflows/verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ env:
RUNNER: &runner "ubuntu-24.04"
TOOL_PYTHON_VERSION: "3.11"
HATCH_VERSION: "1.18.2"
UV_VERSION: "0.13.8"
UV_VERSION: "0.13.9"

concurrency:
group: ${{ github.workflow }}
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ repos:
args: [--markdown-linebreak-ext=md]

- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.30.6
rev: v2.31.2
hooks:
- id: pyproject-fmt

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.17.5 # keep consistent with hatch config
rev: v0.17.6 # keep consistent with hatch config
hooks:
# Run the linter
- id: ruff-check
Expand All @@ -48,7 +48,7 @@ repos:
- id: actionlint

- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: v1.32.0
rev: v1.33.1
hooks:
- id: zizmor

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ accuracy = [
"pyyaml>=6,<7",
]
check-code = [
"ruff==0.17.5", # keep consistent with pre-commit-config.yaml
"ruff==0.17.6", # keep consistent with pre-commit-config.yaml
]
check-fmt = [
{ include-group = "check-code" },
]
check-types = [
"pyrefly==1.4.1",
"pyrefly==1.5",
# The accuracy, fits and speed tools are type-checked too.
"scipy",
"types-pyyaml",
Expand Down
Loading