From 83b422599c5f3c5387ae83ad897d89e683106291 Mon Sep 17 00:00:00 2001 From: haffel Date: Sun, 27 Sep 2026 21:23:28 +0200 Subject: [PATCH] Document Gitea release credentials --- .gitignore | 1 + RELEASING.md | 65 ++++++++++++++++++++++++++++++++++------------------ 2 files changed, 44 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index 2f7896d..bc77873 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ target/ +.gitea_token diff --git a/RELEASING.md b/RELEASING.md index 81e82c6..a2faccc 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -11,7 +11,14 @@ git pull --ff-only git status --short ``` -Choose the next semantic version, such as `1.2.0`, and matching tag `v1.2.0`. +Choose the next semantic version and matching tag, for example `1.3.0` and +`v1.3.0`. Set the version once for the commands below: + +```bash +VERSION="1.3.0" +TAG="v${VERSION}" +``` + Update the version in `Cargo.toml`, the root `cliphoard` package in `Cargo.lock`, `packaging/debian/control`, `packaging/build-deb.sh`, and the versioned `.deb` names in `README.md`. Review changes since the previous tag @@ -25,10 +32,10 @@ cargo fmt --all -- --check cargo test --locked --all-features cargo clippy --locked --all-features -- -D warnings cargo build --release --locked --features gui -CLIPHOARD_VERSION=1.2.0 packaging/build-deb.sh -dpkg-deb --info target/cliphoard_1.2.0_amd64.deb -dpkg-deb --contents target/cliphoard_1.2.0_amd64.deb -sha256sum target/cliphoard_1.2.0_amd64.deb target/release/cliphoard > target/cliphoard_1.2.0_SHA256SUMS +CLIPHOARD_VERSION="$VERSION" packaging/build-deb.sh +dpkg-deb --info "target/cliphoard_${VERSION}_amd64.deb" +dpkg-deb --contents "target/cliphoard_${VERSION}_amd64.deb" +sha256sum "target/cliphoard_${VERSION}_amd64.deb" target/release/cliphoard > "target/cliphoard_${VERSION}_SHA256SUMS" ``` The isolated package path is: @@ -49,8 +56,8 @@ Only commit after the gates pass: git diff --check git status --short git add Cargo.toml Cargo.lock README.md packaging/debian/control packaging/build-deb.sh src .agents RELEASING.md -git commit -m "Release Cliphoard 1.2.0" -git tag -a v1.2.0 -m "Release Cliphoard 1.2.0" +git commit -m "Release Cliphoard ${VERSION}" +git tag -a "$TAG" -m "Release Cliphoard ${VERSION}" ``` Replace `1.2.0` and `v1.2.0` with the actual version. @@ -63,7 +70,7 @@ Confirm the remote has not moved since the preparation pull. Never force-push: git show --stat --oneline HEAD git show --no-patch --decorate HEAD git push origin main -git push origin v1.2.0 +git push origin "$TAG" ``` If the remote changed, stop and reconcile it before pushing. @@ -73,27 +80,40 @@ If the remote changed, stop and reconcile it before pushing. Pushing Git does not upload ignored `target/` files. Create a release for the pushed tag and attach: -- `target/cliphoard_1.2.0_amd64.deb` +- `target/cliphoard_${VERSION}_amd64.deb` - `target/release/cliphoard` -- `target/cliphoard_1.2.0_SHA256SUMS` +- `target/cliphoard_${VERSION}_SHA256SUMS` Using the Gitea web UI: open **Releases**, choose **New Release**, select -`v1.2.0`, enter `Cliphoard 1.2.0`, paste the release notes, upload all three +the release tag, enter `Cliphoard ${VERSION}`, paste the release notes, upload all three files, and publish. Include breaking changes and the plaintext-database deletion warning and commands from `README.md`. -For API automation, create a repository release-write token and set the -installation-specific values without committing them: +For API automation, use the repository release-write token stored locally in +`~/.gitea_token`. The file must contain the raw token on one line, remain +user-readable only, and never be printed, pasted into chat, put in shell +history, or committed. It is ignored by this repository. Load it into the +current process without exposing its value: ```bash -GITEA_URL="https://gitea.example.com" -GITEA_OWNER="owner" -GITEA_REPO="cliphoard" -GITEA_TOKEN="..." -VERSION="1.2.0" +test -r "$HOME/.gitea_token" +test "$(stat -c '%a' "$HOME/.gitea_token")" = 600 +GITEA_TOKEN="$(tr -d '\r\n' < "$HOME/.gitea_token")" +GITEA_URL="https://git.kindle-techprojects.com" +GITEA_OWNER="haffel-public" +GITEA_REPO="app__cliphoard" TAG="v${VERSION}" ``` +Verify the token has repository access before creating a release. The command +discards the response body so it does not expose repository metadata: + +```bash +curl --fail-with-body -sS -o /dev/null \ + -H "Authorization: token ${GITEA_TOKEN}" \ + "${GITEA_URL}/api/v1/repos/${GITEA_OWNER}/${GITEA_REPO}" +``` + Create the release, then upload each artifact: ```bash @@ -111,13 +131,14 @@ for artifact in "target/cliphoard_${VERSION}_amd64.deb" "target/release/cliphoar done ``` -Never put a token in the repository, shell history, or release notes. If no -authenticated Gitea web session or API token is available, stop after the Git -push and resume at publication. +If an earlier attempt already created the release, query the releases endpoint +and upload missing assets instead of creating a duplicate. If no authenticated +Gitea web session or usable API token is available, stop after the Git push and +resume at publication. ## Final smoke check On a clean machine, install the exact `.deb`, start Cliphoard, create/unlock the encrypted database, and check tray, popup, autostart, settings, and -passphrase flows. Verify artifacts against `cliphoard_1.2.0_SHA256SUMS` and +passphrase flows. Verify artifacts against `cliphoard_${VERSION}_SHA256SUMS` and record the release URL, tag, checksums, and test results.