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
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Bug report
description: The extension gives a wrong result, an error or no result.
labels: [bug]
body:
- type: input
id: inkscape
attributes:
label: Inkscape version
description: Help > About Inkscape shows the version.
placeholder: 1.4.4 (dcaf3e7d9e)
validations:
required: true
- type: input
id: system
attributes:
label: Operating system
placeholder: Ubuntu 24.04, Windows 11, macOS 15
validations:
required: true
- type: dropdown
id: mode
attributes:
label: Output mode
options:
- Clipped copies
- Merged outlines
validations:
required: true
- type: textarea
id: problem
attributes:
label: What happened
description: Tell what you expected and what you got. Copy the full text of an error message.
validations:
required: true
- type: textarea
id: file
attributes:
label: SVG file
description: Attach a small SVG file that shows the problem. Drag the file into this box.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
# Updates the SHA pins and their version comments in the workflows.
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
target-branch: develop
commit-message:
prefix: ci(repo)
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release

# Makes a draft GitHub release with the extension zip for each version tag.
on:
push:
tags: ["v*"]

permissions: {}

jobs:
release:
runs-on: ubuntu-24.04
permissions:
contents: write # Create the release and upload the zip
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # The main check below needs the history
persist-credentials: false
- name: Check the tag against main and the version
run: |
git merge-base --is-ancestor "$GITHUB_SHA" origin/main || { echo "Tag $GITHUB_REF_NAME is not on main"; exit 1; }
version=$(python3 -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')
test "$GITHUB_REF_NAME" = "v$version" || { echo "Tag $GITHUB_REF_NAME does not match version $version"; exit 1; }
echo "VERSION=$version" >> "$GITHUB_ENV"
# Same files as the zip of v0.1.1: no top folder, so users extract it into the extensions folder.
- name: Make the zip
run: git archive --format=zip -o "flatternpattern-$VERSION.zip" HEAD LICENSE flatternpattern.inx ./*.py
- name: Write the release notes
run: |
# Release pages show each line break, so join the wrapped lines of a list item.
# Leading blank lines are skipped, so a section with no text gives an empty file.
awk -v v="## [$VERSION]" '
index($0, v) == 1 {on = 1; next}
/^## \[|^\[.*\]: / {on = 0}
!on || (!n && /^$/) {next}
/^ +[^ ]/ && !/^ *([-*+]|[0-9]+\.) / && n {sub(/^ +/, ""); line[n] = line[n] " " $0; next}
{line[++n] = $0}
END {for (i = 1; i <= n; i++) print line[i]}
' CHANGELOG.md > notes.md
test -s notes.md || { echo "CHANGELOG.md has no section for $VERSION"; exit 1; }
# Link to the README so the install steps stay in one place.
printf '\n### Install\n\nDownload `flatternpattern-%s.zip`, then follow the [install steps](%s/blob/%s/README.md#install).\n' \
"$VERSION" "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" "$GITHUB_REF_NAME" >> notes.md
# A draft lets the maintainer read the notes before the release is public.
- name: Create the draft release
env:
GH_TOKEN: ${{ github.token }}
run: gh release create "$GITHUB_REF_NAME" "flatternpattern-$VERSION.zip" --draft --title "$GITHUB_REF_NAME" --notes-file notes.md
28 changes: 28 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Contributing

Thank you for your help. To report a problem, use the
[issue form](https://github.com/weiss-d/FlatternPattern/issues/new/choose).

## Change the code

1. Set up the tools and run the tests. The
[Development](README.md#development) section of the README gives the steps.
2. Make a branch from `develop`.
3. Add a test for each change in behavior. For a change in the output, also
add a small SVG file to `tests/data/flatten/`. The render tests compare
the input and the output of each file in this folder.
4. Open the pull request against `develop`, not `main`.

CI runs the linters and all tests for each pull request.

## Commit messages

Use the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
format: `<type>(<scope>): <description>`. The pre-commit hook checks the
format.

- Write the description in lowercase and in the imperative mood.
- Use one scope from this list: `inx`, `core`, `resolve`, `tiling`,
`clipped`, `merged`, `cleanup`, `tests`, `docs`, `repo`.

Example: `fix(tiling): include stroke box in tile culling`.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ each pull request. The test job uses Ubuntu 24.04 and Inkscape 1.4.4 from the
Inkscape PPA. The developer also runs the tests before each push of a version
change.

A second workflow runs all tests with the nightly build of Inkscape 1.5 from
the Inkscape trunk PPA. It runs for each push to `main`, each pull request
and each Monday. Its result does not block a merge.

The coverage badge at the top of this file shows the part of the statements
in the extension code that the tests run. The value comes from the last CI
run on `main`.
Expand All @@ -291,6 +295,11 @@ another folder, set the `INKSCAPE_EXTENSIONS_DIR` environment variable. The
render tests need the `inkscape` and `rsvg-convert` commands. If a command is
not available, pytest skips the tests that need it.

To make a release, push a tag `vX.Y.Z` on a commit on `main`. The tag must
match the version in `pyproject.toml`, and `CHANGELOG.md` must have a section
for it. The release workflow then makes a draft release with the zip file.
Read the draft and publish it on GitHub.

`docs/spike-merged-mode.md` records the test of the Inkscape actions that
the merged outlines mode uses.

Expand Down
Loading