57 lines
1.2 KiB
Markdown
57 lines
1.2 KiB
Markdown
# Gitea CI and Release
|
|
|
|
This repository uses Gitea Actions workflows under `.gitea/workflows`.
|
|
|
|
## CI
|
|
|
|
`ci.yml` runs on `main` pushes and pull requests:
|
|
|
|
- Frontend: install with pnpm, run tests, build Vite dist.
|
|
- Backend: check Rust formatting and run `cargo test --locked`.
|
|
- Docker: build the production image from `backend/Dockerfile`.
|
|
|
|
## Release
|
|
|
|
`release.yml` runs when a tag matching `v*` is pushed.
|
|
|
|
The workflow:
|
|
|
|
1. Builds and tests the frontend.
|
|
2. Checks and tests the Rust backend.
|
|
3. Builds the release binary.
|
|
4. Packages a runtime bundle with:
|
|
- `fingerprint_receiver`
|
|
- `frontend/dist`
|
|
- `backend/schema.sql`
|
|
- `backend/data`
|
|
- `README.md`
|
|
- `compose.yml`
|
|
5. Creates or reuses the Gitea release for the tag.
|
|
6. Uploads release assets.
|
|
|
|
Gitea 1.26 exposes the built-in job token as `${{ secrets.GITEA_TOKEN }}`. The release workflow requests:
|
|
|
|
```yaml
|
|
permissions:
|
|
code: read
|
|
releases: write
|
|
```
|
|
|
|
## Manual package
|
|
|
|
```bash
|
|
VERSION=v0.1.0 BUILD_DOCKER=1 ./scripts/package-release.sh
|
|
```
|
|
|
|
Assets are written to `release/`.
|
|
|
|
## Manual publish
|
|
|
|
```bash
|
|
GITEA_TOKEN=... \
|
|
GITEA_API_URL=https://git.aiot.ml/api/v1 \
|
|
GITEA_REPOSITORY=kanshan/browser-fingerprint \
|
|
RELEASE_TAG=v0.1.0 \
|
|
./scripts/publish-gitea-release.sh release/*
|
|
```
|