# Releasing

> Version bump, build, and release archive creation

---

## Steps

```bash
# 1. Bump the version (requires a clean git tree)
npx gulp bumpversion

# 2. Build + compile translations + create the release archive
npx gulp archive
```

## What `archive` does

`npx gulp archive` runs `build` → `po2php` → <a href="https://codeberg.org/bschwede/linkenhancer/src/branch/main/util/create-archive.sh" target="_blank" rel="noopener"><code>create-archive.sh</code></a>
. The script:

1. Reads the version from <a href="https://codeberg.org/bschwede/linkenhancer/src/branch/main/latest-version.txt" target="_blank" rel="noopener"><code>latest-version.txt</code></a>
.
2. `rsync`s the module into `dist/linkenhancer/`, excluding everything that is not shipped (below).
3. Zips it to `dist/linkenhancer_v<version>.zip`.

## Excluded from the archive

`create-archive.sh` drops, among others: `node_modules/`, `.git*`, `gulpfile.mjs`, `package*.json`, `phpstan*`, `tests/`, the `util/*` build scripts, `resources/js/src`, `resources/js/tests`, `resources/img/`, `resources/lang/*.po` / `*.mo`, and `.env`. Only the built `bundle*` JS/CSS, the compiled `resources/lang/*.php`, `src/`, `resources/views/`, `resources/css/` and the module entry files are shipped.

## Publishing

1. Tag the release in git.
2. Upload `dist/linkenhancer_v<version>.zip` to a Codeberg / GitHub release with release notes.

> The archive is **not** committed to the repo — it is produced on demand and attached to the release.
