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
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CI

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
test:
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-22.04, windows-latest]

runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'

- name: Install dependencies (Ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8

- name: Install frontend dependencies
run: pnpm install

- name: Install Trunk
run: cargo install trunk

- name: Add wasm target
run: rustup target add wasm32-unknown-unknown

- name: Check frontend (Rust)
run: cargo check

- name: Check backend (Tauri)
run: cargo check
working-directory: src-tauri

- name: Run Clippy (frontend)
run: cargo clippy -- -D warnings
continue-on-error: true

- name: Run Clippy (backend)
run: cargo clippy -- -D warnings
working-directory: src-tauri
continue-on-error: true

- name: Build frontend
run: trunk build

- name: Build Tauri app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
126 changes: 126 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: Release

on:
push:
tags:
- 'v*'
workflow_dispatch:

jobs:
create-release:
runs-on: ubuntu-latest
outputs:
release_id: ${{ steps.create-release.outputs.result }}
release_upload_url: ${{ steps.create-release.outputs.upload_url }}
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Get version
run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV

- name: Create Release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.PACKAGE_VERSION }}
release_name: Logarithm v${{ env.PACKAGE_VERSION }}
body: |
## Logarithm v${{ env.PACKAGE_VERSION }}

### Downloads
- **Windows**: `Logarithm_${{ env.PACKAGE_VERSION }}_x64_en-US.msi` or `.exe`
- **macOS**: `Logarithm_${{ env.PACKAGE_VERSION }}_x64.dmg` (Intel) or `Logarithm_${{ env.PACKAGE_VERSION }}_aarch64.dmg` (Apple Silicon)
- **Linux**: `logarithm_${{ env.PACKAGE_VERSION }}_amd64.deb` or `.AppImage`

### Installation
- **Windows**: Download and run the `.msi` or `.exe` installer
- **macOS**: Download the `.dmg`, open it, and drag Logarithm to Applications
- **Linux**: Download the `.deb` and install with `sudo dpkg -i logarithm_*.deb` or run the `.AppImage`

### What's New
See [CHANGELOG.md](https://github.com/mmycin/Logarithm/blob/main/CHANGELOG.md) for details.
draft: false
prerelease: false

build-tauri:
needs: create-release
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest'
args: '--target aarch64-apple-darwin'
target: 'aarch64-apple-darwin'
- platform: 'macos-latest'
args: '--target x86_64-apple-darwin'
target: 'x86_64-apple-darwin'
- platform: 'ubuntu-22.04'
args: ''
target: 'x86_64-unknown-linux-gnu'
- platform: 'windows-latest'
args: ''
target: 'x86_64-pc-windows-msvc'

runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Install dependencies (Ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8

- name: Install frontend dependencies
run: pnpm install

- name: Install Trunk
run: cargo install trunk

- name: Add wasm target
run: rustup target add wasm32-unknown-unknown

- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
releaseId: ${{ needs.create-release.outputs.release_id }}
args: ${{ matrix.args }}

publish-release:
needs: [create-release, build-tauri]
runs-on: ubuntu-latest
steps:
- name: Publish Release
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.repos.updateRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: ${{ needs.create-release.outputs.release_id }},
draft: false
})
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "logarithm-ui"
version = "0.1.0"
version = "1.0.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
Loading