# Publishing a release, and installing it from its repository Read this only when the user asks for a release, or to install an app from its repository. Publishing pushes to the user's registry and tags their repository, so don't do it on your own. ## Publishing A published app is a tagged commit in its repository plus its image in a registry, from which any Core can install it. 1. Set `image` in `coreapp.toml` to the registry: for an app on a Gitea server, `//` in lowercase (Gitea's container registry is on the same host). `coreapp publish` suggests one from the git remote. `coreapp deploy` keeps working with that name. 2. Raise `version` if this version was published before (published versions are never replaced). 3. Commit everything; `coreapp publish` refuses uncommitted changes. 4. `coreapp publish` builds the image for linux/amd64 (add `--platform linux/amd64,linux/arm64` for ARM Cores too), pushes `image:version`, and tags the commit `v`. It needs `docker login ` first; that's the user's to do (for Gitea, with a token that has the `write:package` scope). 5. The user pushes the commit and tag: `git push && git push origin v`. New apps also have `.gitea/workflows/publish.yml`, which does the same on the Gitea server when a `v*` tag is pushed, if the repository has an Actions runner that can use Docker and the secrets `REGISTRY_USER` and `REGISTRY_TOKEN`. When porting an existing app, copy it from a new app (`coreapp new x`) if the user wants it. ## Installing from the repository To check a release the way a Core's owner will get it: - `coreapp install https:////` installs it on the Core in the VM from the repository (the newest `v*` tag; `@v1.2.0` for another), pulling the published image. `coreapp update ` moves it to a newer release. - The Core reads only `coreapp.toml` and `icon.png` from the repository; `version` has to match the tag. - Coreapps are often private: for a private repository and image, the Core needs a token for the host first, `coreapp login `, which asks for a user name and a read-only token (repositories and packages); or for one owner there, `coreapp login /`, when that owner's apps need another account's token. That's the user's to enter, not yours. - On the same Core, `coreapp deploy` from the folder and `coreapp install` from the repository update the same app (same name, data and database). - A Core keeps running the image it installed, by digest: a release can't be fixed by pushing its tag again (installing it again is refused), so publish a new version. - Going back to an older release needs `coreapp install --downgrade @v`; the user decides that, since the older version may not understand the newer one's data.