# Craft++ release pipeline

The Windows release build creates a self-contained application, updater,
installer, update ZIP, and matching `version.json` under
`codelanguage/artifacts`. `installer/build-release.ps1` builds those artifacts
without deploying them.

To build and upload a Windows release from Linux, run `./build_and_upload.sh`
at the repository root. The legacy `build-release.sh` command calls the same
pipeline. For an SSH deployment, set these variables first:

```sh
export UPDATE_SERVER_SSH='deploy@example-host'
export UPDATE_SERVER_DIR='/root/Desktop/dave-code/codelanguage/artifacts/updateddata'
```

The SSH account must be able to write to `UPDATE_SERVER_DIR`; OpenSSH keys and
host settings can be configured in `~/.ssh/config`. Local deployment is also
supported with `UPDATE_SERVER_DIR=/path/to/updateddata`. The script stages the
ZIP first and publishes `version.json` last, then verifies the deployed metadata
and archive digest. SSH deployments check the public feed and archive by
default. Local deployments probe the public feed when reachable and verify the
local files if it is offline; a reachable but stale public feed fails the
release. Set `PUBLIC_VERIFY=true` to require those public HTTP checks in all
cases. `BASE_URL` overrides the public `/updateddata` URL. Tests run by default;
set `RUN_TESTS=false` only when the tests have already passed for the same
source.

On the Hub host, the default update directory is
`/root/Desktop/dave-code/codelanguage/artifacts/updateddata`, which is also the
Hub service's `CRAFTPLUSPLUS_UPDATE_DATA` setting. If the legacy port-8787
update server is installed, its `/root/Desktop/updateddata` directory is
updated in the same release so older IDE feed settings stay current.

To publish an already-built update from
`codelanguage/artifacts/updateddata` without rebuilding, run
`./upload_update_if_newer.sh`. It compares the artifact feed version against
the Hub's current `version.json`, validates the archive digest and required
executables, and uploads only when the artifact version is newer. The script
also verifies the local deployed files and checks the public feed when it is
reachable. Set `UPDATE_ARTIFACT_DIR` to override the artifact folder or
`UPDATE_SERVER_DIR` to override the Hub destination.

The Windows Build & Upload Launcher uses the same SSH variables. It locates the
repository and `codelanguage/artifacts/updateddata` from the launcher path,
uploads the archive and feed, then checks the public URLs. It needs PowerShell
and OpenSSH available on `PATH`.

The Hub serves `UPDATE_SERVER_DIR` at `/updateddata/` through the HTTPS host in
`BASE_URL`. The IDE checks this feed at startup and
every 15 minutes. It bypasses cached feed responses so a deployment is visible
on the next check.

CI builds and tests artifacts but does not deploy them.
