Compare commits
4 Commits
56df31ee12
...
v0.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ff294724a | ||
|
|
bdffb44bb7 | ||
|
|
1a232f36af | ||
|
|
fb8a8773ea |
@@ -37,3 +37,6 @@ matrix-sdk = { version = "0.16.0", default-features = false, features = [
|
||||
pulldown-cmark = { version = "0.13.1", default-features = false, features = [
|
||||
"html",
|
||||
] }
|
||||
|
||||
# Force bundled SQLite so static musl builds don't need a system libsqlite3
|
||||
libsqlite3-sys = { version = "*", features = ["bundled"] }
|
||||
|
||||
22
README.md
22
README.md
@@ -77,6 +77,28 @@ ldd target/x86_64-unknown-linux-musl/release/story-kit
|
||||
./story-kit
|
||||
```
|
||||
|
||||
## Releasing
|
||||
|
||||
Builds both macOS and Linux binaries locally, tags the repo, and publishes a Gitea release with a changelog.
|
||||
|
||||
**One-time setup:**
|
||||
|
||||
1. Create a Gitea API token at `https://code.crashlabs.io/user/settings/applications` (needs repository read/write)
|
||||
2. Add it to `.env` (gitignored): `GITEA_TOKEN=your_token`
|
||||
3. Ensure `cross` is installed (`cargo install cross`) and Docker is running
|
||||
|
||||
**To release:**
|
||||
|
||||
```bash
|
||||
make release V=0.2.0
|
||||
```
|
||||
|
||||
This will:
|
||||
- Build macOS arm64 (native) and Linux amd64 (static musl via cross/Docker)
|
||||
- Generate a changelog from commits since the last tag
|
||||
- Tag the repo as `v0.2.0` and push the tag
|
||||
- Create a Gitea release with both binaries and the changelog attached
|
||||
|
||||
## Testing
|
||||
|
||||
### Frontend Tests
|
||||
|
||||
@@ -67,6 +67,29 @@ chmod +x "${DIST}"/*
|
||||
echo "==> Binaries:"
|
||||
ls -lh "${DIST}"/
|
||||
|
||||
# ── Changelog ──────────────────────────────────────────────────
|
||||
echo "==> Generating changelog..."
|
||||
PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
|
||||
if [ -n "$PREV_TAG" ]; then
|
||||
CHANGELOG=$(git log "${PREV_TAG}..HEAD" --pretty=format:"- %s" --no-merges)
|
||||
RANGE="${PREV_TAG}...${TAG}"
|
||||
else
|
||||
CHANGELOG=$(git log --pretty=format:"- %s" --no-merges)
|
||||
RANGE="initial...${TAG}"
|
||||
fi
|
||||
|
||||
if [ -z "$CHANGELOG" ]; then
|
||||
CHANGELOG="- No changes since last release"
|
||||
fi
|
||||
|
||||
RELEASE_BODY="## What's Changed
|
||||
|
||||
${CHANGELOG}
|
||||
|
||||
**Full diff:** ${GITEA_URL}/${REPO}/compare/${RANGE}"
|
||||
|
||||
echo "$RELEASE_BODY"
|
||||
|
||||
# ── Tag & Push ─────────────────────────────────────────────────
|
||||
echo "==> Tagging ${TAG}..."
|
||||
git tag -a "$TAG" -m "Release ${TAG}"
|
||||
@@ -74,11 +97,20 @@ git push origin "$TAG"
|
||||
|
||||
# ── Create Gitea Release ──────────────────────────────────────
|
||||
echo "==> Creating release on Gitea..."
|
||||
RELEASE_JSON=$(python3 -c "
|
||||
import json, sys
|
||||
print(json.dumps({
|
||||
'tag_name': sys.argv[1],
|
||||
'name': sys.argv[1],
|
||||
'body': sys.argv[2]
|
||||
}))
|
||||
" "$TAG" "$RELEASE_BODY")
|
||||
|
||||
RELEASE_RESPONSE=$(curl -sf -X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"${GITEA_URL}/api/v1/repos/${REPO}/releases" \
|
||||
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${TAG}\", \"body\": \"Release ${TAG}\"}")
|
||||
-d "$RELEASE_JSON")
|
||||
|
||||
RELEASE_ID=$(echo "$RELEASE_RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
|
||||
|
||||
|
||||
@@ -29,6 +29,19 @@ fn main() {
|
||||
return;
|
||||
}
|
||||
|
||||
// When cross-compiling (e.g. musl via `cross`), the Docker container
|
||||
// has no Node/pnpm. The release script builds macOS first, so
|
||||
// frontend/dist/ already exists. Skip the frontend build in that case.
|
||||
let target = env::var("TARGET").unwrap_or_default();
|
||||
let host = env::var("HOST").unwrap_or_default();
|
||||
if target != host {
|
||||
let dist = Path::new("../frontend/dist");
|
||||
if !dist.exists() {
|
||||
panic!("Cross-compiling but frontend/dist/ is missing. Build macOS first.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
let frontend_dir = Path::new("../frontend");
|
||||
|
||||
// Ensure dependencies are installed and build the frontend bundle.
|
||||
|
||||
Reference in New Issue
Block a user