# Saleculator Release Checklist

Use this checklist before publishing any customer release on saleculator.com.

## Build Inputs

- Confirm the release branch is clean except intentional release changes.
- Confirm `src-pos/com/posics/pos/forms/AppLocal.java` has the intended `APP_VERSION` and `APP_UPDATE`.
- Confirm Java 17 or newer is available on the build machine.
- Confirm ProGuard is installed under `tools/proguard/lib`.
- Confirm Inno Setup 6 is installed before building the Windows installer.
- Confirm Windows SDK Signing Tools are installed if producing a signed public Windows installer.
- Confirm the release signing certificate is available through environment variables, not committed files:
  - PFX mode: `SALECULATOR_CODESIGN_PFX` and `SALECULATOR_CODESIGN_PASSWORD`
  - Certificate store mode: `SALECULATOR_CODESIGN_CERT_SHA1`

## Build Commands

Windows:

```bat
scripts\release-windows.bat
```

This single Windows release gate builds the installer/runtime ZIP, validates the runtime ZIP, checks Linux script line endings, runs the Windows installer smoke test, rebuilds website release metadata, and runs the website metadata verifier when the sibling website repo is available.

On locked build machines where Windows Device Guard blocks unsigned installer execution, set `SALECULATOR_SKIP_INSTALLER_SMOKE=1` only to complete artifact/metadata generation. The installer smoke test must still pass on a Windows validation machine before public release.

For a signed public installer, set `SALECULATOR_SIGN_INSTALLER=1` and `SALECULATOR_REQUIRE_SIGNED_INSTALLER=1` before running the release gate.

For a customer-facing release, prefer the stricter gate:

```bat
scripts\release-customer-windows.bat
```

It fails unless signing is configured and the installer smoke test is enabled.

The individual commands are:

```bat
scripts\build-windows-installer.bat
scripts\validate-runtime-package.bat release\saleculator-<version>-runtime.zip
scripts\smoke-windows-installer.bat release\Saleculator-<version>-Setup.exe
release\saleculator-<version>\scripts\preflight.bat
```

Linux/Raspberry build validation:

```sh
scripts/package-release.sh
scripts/validate-runtime-package.sh release/saleculator-<version>-runtime.zip
release/saleculator-<version>/scripts/preflight.sh
```

## Artifact Names

- Windows installer: `release/Saleculator-<version>-Setup.exe`
- Vendor/runtime ZIP: `release/saleculator-<version>-runtime.zip`
- Runtime folder: `release/saleculator-<version>/`
- Application JAR inside the package: `dist/Saleculator.jar`

## Hashes

Generate hashes for the files that will be uploaded:

```powershell
Get-FileHash release\Saleculator-<version>-Setup.exe, release\saleculator-<version>-runtime.zip -Algorithm SHA256
```

Publish those hashes on the release page and in the public JSON metadata. The runtime ZIP also contains `SHA256SUMS.txt` for internal package files.

## Public Upload

Upload this set to `https://www.saleculator.com/releases/<version>/`:

- `Saleculator-<version>-Setup.exe`
- `saleculator-<version>-runtime.zip`
- Release notes copied from `RELEASE-NOTES.md`
- SHA-256 hashes for both uploaded artifacts
- Per-version machine-readable metadata at `https://www.saleculator.com/releases/<version>/release.json`
- Latest release metadata at `https://www.saleculator.com/releases/latest.json`
- Download alias metadata at `https://www.saleculator.com/downloads/latest.json`
- Java 17 minimum runtime note
- Setup mode explanation: single machine/main POS and network client use the same installer

## Smoke Tests

Run these before announcing the release:

- Fresh Windows install from `Saleculator-<version>-Setup.exe`.
- First Run Setup option 1 creates or configures the local/main MySQL database.
- First Run Setup option 2 writes a network `db.URL` to an existing MySQL host.
- First Run Setup option 3 validates the configured MySQL connection.
- New customer reaches activation and can request the 30 day trial key using **START TRIAL**.
- New customer completes first-run business setup and receipt header/footer appear on a test receipt.
- Network client connected to the same MySQL database sees the shared `Business.Profile` values.
- Operator reaches PIN login after successful activation/setup.
- One test sale completes and prints to screen printer.
- Maintenance backup creates a backup using configured backup table resources.
- Support info script creates a support file without exposing passwords.
- Runtime ZIP launches on Linux/minimal Debian.
- Raspberry/minimal Debian appliance mode boots through Saleculator loader to the PIN login screen.

## Publish Gate

Do not publish until all of these are true:

- Runtime ZIP validator passes.
- Windows installer builds successfully.
- `scripts\release-windows.bat` passes on the release build machine.
- Public Windows installer has a valid Authenticode signature.
- Public hashes are generated after the final build.
- Release notes match the artifact version.
- Installer and runtime ZIP are both available on saleculator.com.
- `release.json`, `releases/latest.json`, and `downloads/latest.json` return HTTP 200.
- JSON artifact URLs download successfully, and each JSON SHA-256 value matches the public `SHA256SUMS.txt`.
- JSON metadata confirms the intended version, Java minimum runtime, MySQL-only database support, local/offline operation, and 30 day trial path.
- JSON metadata exposes `publicWindowsInstallerRequiresSignature`, Windows installer `signatureStatus`, and per-artifact `installPolicy`.
- Normal customer install is announced only when the Windows installer `installPolicy` is `customer-install-allowed`.
- Trial path has been checked for a new customer.
