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

on:
push:
branches: [main]
pull_request:

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always

jobs:
fmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- run: cargo fmt --all --check

clippy:
name: clippy + tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libxkbcommon-dev libxkbcommon-x11-dev libwayland-dev libvulkan-dev \
libx11-xcb-dev libxcb1-dev libfontconfig-dev libfreetype-dev libssl-dev libusb-1.0-0-dev

- uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- uses: swatinem/rust-cache@v2

- run: cargo clippy --all-targets --locked -- -D warnings

# Device tests are #[ignore]d; these need no phone.
- run: cargo test --locked
80 changes: 53 additions & 27 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,62 +5,88 @@ on:

jobs:
build:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: ubuntu-latest
os_name: linux
args: ''
target: x86_64-unknown-linux-gnu
formats: deb,appimage
- platform: windows-latest
os_name: windows
args: ''
- platform: 'macos-latest' # for Arm based macs (M1 and above).
target: x86_64-pc-windows-msvc
formats: nsis
- platform: macos-latest # Apple Silicon
os_name: macos (ARM)
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest' # for Intel based macs.
target: aarch64-apple-darwin
formats: dmg
- platform: macos-latest # Intel
os_name: macos (Intel)
args: '--target x86_64-apple-darwin'
target: x86_64-apple-darwin
formats: dmg

name: Building for ${{ matrix.os_name }}
runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v4

- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
sudo apt-get install -y libxkbcommon-dev libxkbcommon-x11-dev libwayland-dev libvulkan-dev \
libx11-xcb-dev libxcb1-dev libfontconfig-dev libfreetype-dev libssl-dev libusb-1.0-0-dev

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
targets: ${{ matrix.target }}

- name: Rust cache
uses: swatinem/rust-cache@v2

- name: install cargo-packager
run: cargo install cargo-packager --locked

- name: build
run: cargo build --release --target ${{ matrix.target }}

- name: package
run: cargo packager --release --target ${{ matrix.target }} --formats ${{ matrix.formats }} --out-dir dist

- uses: actions/upload-artifact@v4
with:
workspaces: './src-tauri -> target'
name: starter-${{ matrix.target }}
path: |
dist/*.dmg
dist/*.deb
dist/*.AppImage
dist/*.exe
if-no-files-found: error

release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- name: read version
id: version
run: echo "version=$(grep -m1 '^version' Cargo.toml | cut -d'"' -f2)" >> "$GITHUB_OUTPUT"

- uses: oven-sh/setup-bun@v2
- uses: actions/download-artifact@v4
with:
bun-version: latest
path: dist
merge-multiple: true

- name: install frontend dependencies
run: bun install

- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: softprops/action-gh-release@v2
with:
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: 'Kodular Starter v__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}
tag_name: v${{ steps.version.outputs.version }}
name: Kodular Starter v${{ steps.version.outputs.version }}
body: See the assets to download this version and install.
draft: true
files: dist/*
24 changes: 3 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
/target
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
../.vscode/*
!../.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.vscode/settings.json
.vscode/*
!.vscode/extensions.json
/dist
4 changes: 1 addition & 3 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{
"recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
}
{ "recommendations": ["rust-lang.rust-analyzer"] }
Loading
Loading