Skip to content

Dorde/task/align GitHub workflows - #58

Merged
djordjeh merged 4 commits into
masterfrom
dorde/task/align-github-workflows
Aug 19, 2026
Merged

Dorde/task/align GitHub workflows#58
djordjeh merged 4 commits into
masterfrom
dorde/task/align-github-workflows

Conversation

@djordjeh

Copy link
Copy Markdown
Contributor

No description provided.

djordjeh and others added 2 commits August 18, 2026 14:33
The develop branch is gone, so CI runs on master instead:

- Remove develop.yml
- Add master.yml running spotlessCheck, unit tests and instrumented
  tests on push to master
- Reshape pr-checks.yml to match scan-engine
- Trigger releases from version tags instead of pushes to master, and
  verify the tag matches the print-engine version in libs.versions.toml

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 18, 2026 12:38
@djordjeh
djordjeh requested a review from a team as a code owner August 18, 2026 12:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates CI/release automation for the Tillhub Print Engine repository by aligning GitHub Actions workflows (PR checks, master-branch CI, and release publishing), and also adjusts Maven publishing POM metadata.

Changes:

  • Switch release publishing workflow to run on version tags and add a guard to ensure the pushed tag matches gradle/libs.versions.toml.
  • Reformat/rename the PR checks workflow job for cleaner YAML structure.
  • Add a new master branch CI workflow and remove the develop branch workflow.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
print-engine/build.gradle.kts Removes two developer entries from Maven POM metadata.
.github/workflows/release.yml Triggers publishing on tags and adds a “tag matches version” verification step.
.github/workflows/pr-checks.yml YAML cleanup and job renaming for PR CI checks.
.github/workflows/master.yml New master-branch CI that runs lint/unit tests + connected Android tests.
.github/workflows/develop.yml Removes develop-branch CI workflow (no longer runs on develop pushes).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

push:
branches: [ "master" ]
tags:
- '[0-9]+.[0-9]+.[0-9]+'
Comment on lines +21 to +25
VERSION=$(grep -m1 '^print-engine = ' gradle/libs.versions.toml | cut -d'"' -f2)
if [ "${GITHUB_REF_NAME}" != "${VERSION}" ]; then
echo "Tag ${GITHUB_REF_NAME} does not match libs.versions.toml version ${VERSION}"
exit 1
fi
Comment on lines 144 to 151
// Specify developers information
developers {
developer {
id.set("djordjeh")
name.set("Đorđe Hrnjez")
email.set("dorde.hrnjez@unzer.com")
}
developer {
id.set("SloInfinity")
name.set("Martin Sirok")
email.set("m.sirok.ext@unzer.com")
}
developer {
id.set("shekar-allam")
name.set("Chandrashekar Allam")
email.set("chandrashekar.allam@unzer.com")
}
}
Comment on lines +3 to +6
on:
push:
branches: [ "master" ]

djordjeh and others added 2 commits August 19, 2026 10:34
Receipts silently failed to print on PAX and Verifone when a header or
footer image was large. Those printers inline every image into the
receipt HTML as base64 and hand the whole string to the vendor service in
one Binder transaction, capped at ~1 MB per process. Nothing on that path
normalised the image, and a failed transaction was never reported back to
the caller.

- Normalise images in the HTML path: downscale to the print head width
  (never upscaling) and dither to 1 bit monochrome before encoding. The
  head cannot render colour or detail beyond its own width, so nothing
  printable is lost. Barcodes and QR codes are generated for the target
  printer and already monochrome, so they skip normalisation - rescaling
  them would only risk their scannability.
- Expose the print head width on PrintingPaperSpec, so the target width
  comes from the device rather than a constant hardcoded per app.
- Surface transport failures: the PAX and Verifone print paths reported
  them only through the printer state, so startPrintJob returned Success
  for a receipt that was never printed. Both now rethrow, and
  withPrinterCatching turns them into a PrinterResult.Error.
- Use Base64.NO_WRAP on Android: DEFAULT inserts CRLF every 76
  characters, ~2.7% of waste inside a data URI, and iOS never wrapped.

The pixel work lives in commonMain as plain IntArray operations, so the
whole algorithm is shared and unit tested through MonochromeImage.
normalize; only building a bitmap from pixels is expect/actual (Android
Bitmap, Skia on iOS).

Native plugins are untouched - Epson, Star and Sunmi already normalise
inside their vendor SDKs and must not be processed twice.

The payload size guard the ticket also asks for is deliberately left out:
any byte budget would be a guess until it is measured on a real PAX and
Verifone, and a wrong one would reject receipts that print fine today.

Bumps the version to 3.1.0 for release.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Gives the header/footer image path something to exercise on a real
device: apex.png as the header, photoshoppng.png as the footer. The
latter is 2000x1400 at 233 KB, close to the image size that triggered
UNTIL-21656, so it covers the downscale path rather than only the dither.

The print job moves out of the companion object, since decoding a
drawable needs resources.

The drawables sit in drawable-nodpi so they are decoded at their authored
pixel size instead of being density scaled for the screen.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@djordjeh
djordjeh merged commit 75c1c6d into master Aug 19, 2026
1 check passed
@djordjeh
djordjeh deleted the dorde/task/align-github-workflows branch August 19, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants