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
5 changes: 5 additions & 0 deletions .github/maintainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- Generated by mkmaintainer.py; do not edit -->

## Maintainer issue templates

- [Release checklist](https://github.com/openslide/openslide-java/issues/new?title=Release+X.Y.Z&body=%23+OpenSlide+Java+release+process%0A%0A-+%5B+%5D+Update+%60CHANGELOG.md%60+and+version+in+%60pom.xml%60%0A-+%5B+%5D+Create+and+push+signed+tag%0A-+%5B+%5D+Verify+that+GitHub+Actions+created+a+%5BGitHub+release%5D%28https%3A%2F%2Fgithub.com%2Fopenslide%2Fopenslide-java%2Freleases%29+with+release+notes+and+a+JAR%0A-+%5B+%5D+Update+website%3A+%60_data%2Freleases.yaml%60%2C+%60_includes%2Fnews.md%60%0A-+%5B+%5D+Send+mail+to+-announce+and+-users%0A-+%5B+%5D+Post+to+%5Bforum.image.sc%5D%28https%3A%2F%2Fforum.image.sc%2Fc%2Fannouncements%2F10%29&labels=release)
25 changes: 25 additions & 0 deletions .github/maintainer/mkmaintainer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/python

from pathlib import Path
from urllib.parse import urlencode

import yaml

dir = Path(__file__).parent
with open(dir / 'README.md', 'w') as fh:
fh.write('<!-- Generated by mkmaintainer.py; do not edit -->\n\n')
fh.write('## Maintainer issue templates\n\n')
for path in sorted(dir.iterdir()):
if path.name == 'README.md' or path.suffix != '.md':
continue
_, front, body = path.read_text().split('---\n', 2)
info = yaml.safe_load(front)
args = urlencode(
{
'title': info['title'],
'body': body.strip(),
'labels': ','.join(info.get('labels', [])),
}
)
url = f"https://github.com/{info['repo']}/issues/new?{args}"
fh.write(f"- [{info['link-text']}]({url})\n")
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
link-text: Release checklist
repo: openslide/openslide-java
title: Release X.Y.Z
labels: [release]
---

# OpenSlide Java release process

- [ ] Update `CHANGELOG.md` and version in `pom.xml`
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/java.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,22 @@ permissions:
contents: read

jobs:
pre-commit:
name: Rerun pre-commit checks
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Run pre-commit hooks
uses: pre-commit/action@v3.0.1

build:
name: Build
needs: pre-commit
runs-on: ${{ matrix.os }}
outputs:
dist-base: ${{ steps.dist.outputs.dist-base }}
Expand Down
37 changes: 37 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# exclude vendored files
exclude: '^(COPYING\.LESSER)$'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
- id: check-vcs-permalinks
- id: check-yaml
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
name: Check spelling with codespell
additional_dependencies:
- tomli # Python < 3.11

- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes

- repo: local
hooks:
- id: mkmaintainer
name: Sync maintainer issue templates
entry: .github/maintainer/mkmaintainer.py
files: .github/maintainer/
language: python
additional_dependencies: [PyYAML]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ mvn
The JAR will be in `target/openslide-java-*.jar`.

If you have multiple JVMs on your system, and Maven defaults to a version
older than 22, you might need to set `JAVA_HOME`. For exmaple, on Fedora:
older than 22, you might need to set `JAVA_HOME`. For example, on Fedora:

```
JAVA_HOME=/usr/lib/jvm/java-22 mvn
Expand Down
Loading