This guide explains the automated release workflow for TrustLink and how to work with it effectively.
-
Write code and commit with conventional format:
git commit -m "feat(storage): add dual indexing" -
Push to a feature branch and open a PR:
git push origin feat/your-feature
-
PR validation:
- CI runs tests and checks code quality
- Commit message validation ensures conventional format
- At least one approval required
-
Merge to main:
- Use "Squash and merge" or "Create a merge commit"
- Do NOT use "Rebase and merge" (loses commit history)
-
Release Please handles the rest:
- Automatically creates a Release PR
- Updates version and changelog
- You don't need to do anything else
-
Monitor Release PRs:
- Release Please creates a PR after commits are merged to main
- Review the version bump and changelog
- Merge the Release PR
-
GitHub Release is created automatically:
- WASM artifacts are built and attached
- Release notes are generated from commits
- No manual action needed
<type>(<scope>): <subject>
<body>
<footer>
| Type | Meaning | Version Impact |
|---|---|---|
feat |
New feature | Minor bump (0.1.0 → 0.2.0) |
fix |
Bug fix | Patch bump (0.1.0 → 0.1.1) |
docs |
Documentation | No version bump |
test |
Tests | No version bump |
refactor |
Code refactoring | No version bump |
perf |
Performance improvement | Patch bump |
chore |
Build, CI, dependencies | No version bump |
ci |
CI/CD changes | No version bump |
build |
Build system changes | No version bump |
Narrow the change to a specific area:
storage— Storage layervalidation— Authorization/validationevents— Event emissionindexer— Off-chain indexersdk— TypeScript SDKci— CI/CD workflowsdocs— Documentation
- 50 characters max
- Start with lowercase
- Use imperative mood ("add" not "adds" or "added")
- No period at the end
Explain why the change was made:
feat(storage): add dual indexing for subject and issuer lookups
The previous single index on subject made issuer-based queries O(n).
This adds a parallel index on issuer to enable fast lookups in both
directions. Queries now complete in O(log n) time.
Reference issues or breaking changes:
Closes #42
Closes #99
BREAKING CHANGE: removed the `get_all_attestations` function
feat(storage): add dual indexing for subject and issuer lookups
fix(validation): reject attestations with valid_from in the past
Previously, valid_from was only checked against the current time.
Now we also reject any valid_from that is before the current ledger
timestamp, preventing backdated attestations.
Closes #123
docs: update deployment guide with testnet contract IDs
test(events): add test for audit log append-only property
refactor: extract fee calculation into separate function
perf(storage): optimize subject index lookup with binary search
Reduces query time from O(n) to O(log n) for large attestation sets.
❌ Updated stuff
❌ Fix bug
❌ feat: Add new feature.
❌ FEAT: ADD FEATURE
❌ feat(storage): added dual indexing
❌ feat(storage): add dual indexing.
Commits merged:
feat(storage): add dual indexingfeat(validation): add new authorization checkfix(events): emit correct event data
Result: Minor version bump
- 0.1.0 → 0.2.0
Changelog:
## [0.2.0] - 2024-03-26
### Features
- add dual indexing
- add new authorization check
### Bug Fixes
- emit correct event dataCommits merged:
fix(validation): reject invalid timestampsfix(storage): handle edge case in pagination
Result: Patch version bump
- 0.1.0 → 0.1.1
Changelog:
## [0.1.1] - 2024-03-26
### Bug Fixes
- reject invalid timestamps
- handle edge case in paginationCommits merged:
docs: update READMEtest: add edge case testschore: update dependencies
Result: No version bump, no release created
Commits merged:
feat(storage): redesign storage layoutBREAKING CHANGE: removed get_all_attestations function
Result: Major version bump
- 0.1.0 → 1.0.0
Trigger: Push to main
What it does:
- Analyzes commits since last release
- Determines next version
- Creates or updates Release PR
- Updates
Cargo.tomlandCHANGELOG.md
Configuration: release-please-config.json
Trigger: GitHub Release published
What it does:
- Checks out release tag
- Builds WASM contract
- Optimizes with
soroban contract optimize - Uploads artifacts to release
Artifacts:
trustlink.wasm— Unoptimizedtrustlink.optimized.wasm— Optimized for production
Trigger: PR opened or updated
What it does:
- Validates PR title format
- Checks commit messages
- Blocks merge if invalid
Controls Release Please behavior:
{
"packages": {
".": {
"changelog-path": "CHANGELOG.md",
"release-type": "rust",
"prerelease": false
}
},
"changelog-sections": [
{"type": "feat", "section": "Features", "hidden": false},
{"type": "fix", "section": "Bug Fixes", "hidden": false},
...
]
}Validates commit message format locally and in CI:
{
"extends": ["@commitlint/config-conventional"],
"rules": {
"type-enum": [2, "always", ["feat", "fix", "docs", ...]],
"subject-case": [2, "never", ["start-case", "pascal-case"]],
...
}
}Runs validation before commits:
repos:
- repo: https://github.com/commitlint-rs/commitlint
rev: v0.1.1
hooks:
- id: commitlint
stages: [commit-msg]Problem: No Release PR appears after merging commits.
Causes:
- Commits don't follow conventional format
- All commits are
docs,test, orchore(no version bump) - Release Please workflow is disabled
Solution:
- Check commit messages:
git log --oneline main..origin/main - Ensure at least one
featorfixcommit - Check
.github/workflows/release-please.ymlis enabled
Problem: Version bumped more or less than expected.
Cause: Commit types don't match expectations.
Solution:
- Review commits:
git log --oneline <last-tag>..main - Check commit format against Commit Message Format
- Verify
release-please-config.jsonchangelog-types
Problem: Pre-commit hook rejects commit message.
Cause: Message doesn't match .commitlintrc.json rules.
Solution:
- Review error message
- Fix commit message format
- Try again:
git commit --amend
Problem: PR blocked by validate-commits workflow.
Cause: PR title or commits don't follow conventional format.
Solution:
- Update PR title to follow format:
feat: description - Or squash commits into one with proper format
- Force-push to update PR
Problem: GitHub Release created but no WASM files attached.
Cause: publish-release workflow failed.
Solution:
- Check workflow run: https://github.com/TrustLink/TrustLink/actions
- Review logs for build errors
- Manually build and attach if needed:
cargo build --target wasm32-unknown-unknown --release soroban contract optimize \ --wasm target/wasm32-unknown-unknown/release/trustlink.wasm \ --wasm-out target/wasm32-unknown-unknown/release/trustlink.optimized.wasm gh release upload v0.2.0 \ target/wasm32-unknown-unknown/release/trustlink.wasm \ target/wasm32-unknown-unknown/release/trustlink.optimized.wasm
✅ Good:
feat(storage): add dual indexing for subject and issuer lookups
The previous single index on subject made issuer-based queries O(n).
This adds a parallel index to enable fast lookups in both directions.
❌ Bad:
feat: update storage
✅ Good:
feat(storage): add subject index
feat(storage): add issuer index
❌ Bad:
feat(storage): add subject and issuer indexes and fix pagination bug
When merging a PR with multiple commits, use "Squash and merge" to create a single, clean commit message:
git merge --squash feature-branch
git commit -m "feat(storage): add dual indexing"This ensures the changelog has clean, meaningful entries.
fix(validation): reject invalid timestamps
Closes #42
This automatically closes the issue when the commit is merged.
feat(storage): redesign storage layout
BREAKING CHANGE: removed get_all_attestations function
This triggers a major version bump (0.1.0 → 1.0.0).
If automated release fails, you can manually create a release:
-
Create release tag:
git tag -a v0.2.0 -m "Release v0.2.0" git push origin v0.2.0 -
Build artifacts:
cargo build --target wasm32-unknown-unknown --release soroban contract optimize \ --wasm target/wasm32-unknown-unknown/release/trustlink.wasm \ --wasm-out target/wasm32-unknown-unknown/release/trustlink.optimized.wasm
-
Create GitHub Release:
gh release create v0.2.0 \ target/wasm32-unknown-unknown/release/trustlink.wasm \ target/wasm32-unknown-unknown/release/trustlink.optimized.wasm \ --title "TrustLink v0.2.0" \ --notes "See CHANGELOG.md for details"