chore: bump to v0.3.1 #104
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| branches: [master] | |
| paths-ignore: | |
| - "*.md" | |
| - "README.md" | |
| - "LICENSE" | |
| - "docs/**" | |
| - ".github/workflows/ci.yml" | |
| concurrency: | |
| group: release | |
| cancel-in-progress: true | |
| jobs: | |
| # First job: bump the patch version in all manifest files AND tag in one | |
| # atomic commit, so the built artifacts match the GitHub release tag. | |
| tag: | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| contents: write | |
| outputs: | |
| tag: ${{ steps.bump.outputs.tag }} | |
| version: ${{ steps.bump.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| - name: Compute next version and bump manifest files | |
| id: bump | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| # Current version from package.json | |
| CURRENT=$(jq -r .version package.json) | |
| echo "Current manifest version: ${CURRENT}" | |
| # If v${CURRENT} already has a tag, bump the patch. Otherwise | |
| # release as-is — this lets a developer bump the minor or major | |
| # manually in a commit and have the next push pick it up exactly. | |
| if git rev-parse --verify --quiet "refs/tags/v${CURRENT}" >/dev/null; then | |
| IFS=. read -r MAJOR MINOR PATCH <<< "${CURRENT}" | |
| NEW_PATCH=$((PATCH + 1)) | |
| VERSION="${MAJOR}.${MINOR}.${NEW_PATCH}" | |
| echo "v${CURRENT} already tagged — bumping patch to ${VERSION}" | |
| else | |
| VERSION="${CURRENT}" | |
| echo "No tag for v${CURRENT} yet — releasing as-is" | |
| fi | |
| NEW_TAG="v${VERSION}" | |
| # 1. package.json + package-lock.json (npm handles both) | |
| npm version "${VERSION}" --no-git-tag-version --allow-same-version | |
| # 2. tauri.conf.json (jq for safe JSON edit) | |
| jq --arg v "${VERSION}" '.version = $v' src-tauri/tauri.conf.json \ | |
| > src-tauri/tauri.conf.json.tmp | |
| mv src-tauri/tauri.conf.json.tmp src-tauri/tauri.conf.json | |
| # 3. Cargo.toml — replace the FIRST `version = "..."` line only | |
| # (the package version, not any dependency versions) | |
| sed -i "0,/^version = \"[^\"]*\"$/s//version = \"${VERSION}\"/" \ | |
| src-tauri/Cargo.toml | |
| # 4. Cargo.lock — update the noctodeus package entry | |
| awk -v ver="${VERSION}" ' | |
| /^name = "noctodeus"$/ { | |
| getline | |
| sub(/"[^"]*"/, "\"" ver "\"") | |
| next | |
| } | |
| { print } | |
| ' src-tauri/Cargo.lock > src-tauri/Cargo.lock.tmp | |
| mv src-tauri/Cargo.lock.tmp src-tauri/Cargo.lock | |
| echo "tag=${NEW_TAG}" >> "$GITHUB_OUTPUT" | |
| echo "version=${VERSION}" >> "$GITHUB_OUTPUT" | |
| - name: Commit bump and push tag | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| # Only commit if the bump actually changed files. The first release | |
| # at a given version won't — the manifest is already at VERSION. | |
| if git diff --quiet -- \ | |
| package.json \ | |
| package-lock.json \ | |
| src-tauri/tauri.conf.json \ | |
| src-tauri/Cargo.toml \ | |
| src-tauri/Cargo.lock; then | |
| echo "No manifest changes to commit — tagging current HEAD." | |
| else | |
| git add \ | |
| package.json \ | |
| package-lock.json \ | |
| src-tauri/tauri.conf.json \ | |
| src-tauri/Cargo.toml \ | |
| src-tauri/Cargo.lock | |
| git commit -m "chore: release ${{ steps.bump.outputs.tag }}" | |
| git push origin HEAD:master | |
| fi | |
| git tag "${{ steps.bump.outputs.tag }}" | |
| git push origin "${{ steps.bump.outputs.tag }}" | |
| # Second job: build on all platforms using the new tag | |
| build: | |
| needs: tag | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: macos-latest | |
| args: "--target aarch64-apple-darwin" | |
| label: "macOS ARM64" | |
| - platform: macos-latest | |
| args: "--target x86_64-apple-darwin" | |
| label: "macOS x64" | |
| - platform: ubuntu-22.04 | |
| args: "" | |
| label: "Linux x64" | |
| # Windows x64 disabled — MSVC linker error 1169 (duplicate | |
| # symbols) due to large Rust dependency graph (ort + memvid-core | |
| # + tantivy). Needs dependency refactor to re-enable. | |
| runs-on: ${{ matrix.platform }} | |
| name: Build (${{ matrix.label }}) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ needs.tag.outputs.tag }} | |
| - name: Install Linux dependencies | |
| if: matrix.platform == 'ubuntu-22.04' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| cache: npm | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} | |
| - name: Rust cache | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: "./src-tauri -> target" | |
| - name: Install frontend dependencies | |
| run: npm ci | |
| - name: Build and release | |
| uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tagName: ${{ needs.tag.outputs.tag }} | |
| releaseName: "Noctodeus ${{ needs.tag.outputs.tag }}" | |
| releaseBody: | | |
| ## Install | |
| **macOS** — download the `.dmg`, open it, drag Noctodeus to Applications. On first launch macOS will refuse to run it because the app is not code-signed. Fix it with one command: | |
| ```bash | |
| xattr -cr /Applications/Noctodeus.app | |
| ``` | |
| Then open normally. | |
| **Linux** — download the `.AppImage`, `chmod +x` it, and run. Or install the `.deb`: `sudo dpkg -i noctodeus_*.deb`. | |
| **Windows** — not available yet. See the README for status. | |
| --- | |
| See the assets below to download. | |
| releaseDraft: false | |
| prerelease: false | |
| args: ${{ matrix.args }} |