Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ jobs:
- name: Install frontend dependencies
run: pnpm install

- name: Bump version from tag
if: startsWith(github.ref, 'refs/tags/')
env:
RELEASE_VERSION: ${{ github.ref_name }}
run: make bump-version

- name: Build and release
uses: tauri-apps/tauri-action@v0
env:
Expand Down
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ members = [
"apps/desktop/src-tauri",
]

[workspace.package]
version = "0.1.0"
edition = "2021"
license = "MIT"

[workspace.dependencies]
# shared across all crates
serde = { version = "1", features = ["derive"] }
Expand Down
24 changes: 23 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.PHONY: help install dev build build-desktop build-cli test test-parser test-sync cli
.PHONY: help install dev build build-desktop build-cli test test-parser test-sync cli bump-version release

RELEASE_VERSION ?=
# Strip leading 'v' for version files (v0.2.0 → 0.2.0); evaluated lazily
_VER = $(patsubst v%,%,$(RELEASE_VERSION))

.DEFAULT_GOAL := help

Expand Down Expand Up @@ -44,3 +48,21 @@ test-parser: ## Run parser unit tests

test-sync: ## Run sync + SQLite tests
cargo test -p nichinichi-sync

# ── Release ────────────────────────────────────────────────────────────────────

bump-version: ## Update version files from RELEASE_VERSION (RELEASE_VERSION=vX.Y.Z required)
@test -n "$(RELEASE_VERSION)" || (echo "error: RELEASE_VERSION is required, e.g. RELEASE_VERSION=v0.2.0 make bump-version" && exit 1)
sed -i'' -e 's/^version = ".*"/version = "$(_VER)"/' Cargo.toml
cd apps/desktop && npm pkg set version=$(_VER)
cd apps/desktop/src-tauri && \
tmp=$$(mktemp) && \
jq '.version = "$(_VER)"' tauri.conf.json > $$tmp && \
mv $$tmp tauri.conf.json

release: bump-version ## Bump versions, commit, tag, and push (RELEASE_VERSION=vX.Y.Z required)
cargo check
git add Cargo.toml apps/desktop/package.json apps/desktop/src-tauri/tauri.conf.json
git commit -m "chore: release $(RELEASE_VERSION)"
git tag $(RELEASE_VERSION)
git push origin HEAD $(RELEASE_VERSION)
6 changes: 3 additions & 3 deletions apps/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "nichinichi-cli"
version = "0.1.0"
edition = "2021"
license = "MIT"
version.workspace = true
edition.workspace = true
license.workspace = true

[[bin]]
name = "nichinichi"
Expand Down
6 changes: 3 additions & 3 deletions apps/desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "nichinichi-desktop"
version = "0.1.0"
edition = "2021"
license = "MIT"
version.workspace = true
edition.workspace = true
license.workspace = true

[lib]
name = "nichinichi_desktop_lib"
Expand Down
6 changes: 3 additions & 3 deletions crates/ai/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "nichinichi-ai"
version = "0.1.0"
edition = "2021"
license = "MIT"
version.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
nichinichi-types = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions crates/parser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "nichinichi-parser"
version = "0.1.0"
edition = "2021"
license = "MIT"
version.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
nichinichi-types = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions crates/sync/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "nichinichi-sync"
version = "0.1.0"
edition = "2021"
license = "MIT"
version.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
nichinichi-types = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions crates/types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "nichinichi-types"
version = "0.1.0"
edition = "2021"
license = "MIT"
version.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
serde = { workspace = true }
Expand Down
Loading