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

# Format, lint and test the macOS desktop app (its own Cargo workspace, so ci.yml never builds it).
# Runs only when the app or this workflow changes: macOS runner minutes are billed.
on:
push:
branches: [main]
paths:
- 'crucible-desktop/**'
- '.github/workflows/desktop.yml'
pull_request:
paths:
- 'crucible-desktop/**'
- '.github/workflows/desktop.yml'
workflow_dispatch:

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

permissions:
contents: read

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: "0"
CARGO_NET_RETRY: "10"

jobs:
check:
runs-on: macos-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

- uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1.16.1
with:
components: rustfmt, clippy
cache-workspaces: crucible-desktop -> target

- name: fmt
working-directory: crucible-desktop
run: cargo fmt --check

- name: clippy
working-directory: crucible-desktop
run: cargo clippy --all-targets --all-features --locked -- -D warnings

- name: test
working-directory: crucible-desktop
run: cargo test --locked
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,48 @@ jobs:
gh release create "$tag" \
--title "$tag" --generate-notes --verify-tag 2>/dev/null || true
gh release upload "$tag" dist/* --clobber

# The macOS desktop app, signed ad hoc: a downloaded copy needs Open Anyway (or
# `xattr -d com.apple.quarantine`) on first launch.
desktop:
runs-on: macos-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
ref: ${{ inputs.tag || github.ref }}

- uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1.16.1
with:
cache-workspaces: crucible-desktop -> target

- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0

- name: Build Crucible.app
working-directory: crucible-desktop
run: |
set -euo pipefail
tag="${{ inputs.tag || github.ref_name }}"
version="${tag#v}"
[[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]] || version="0.0.0"
bunx @tauri-apps/cli@2.12.1 build --bundles app --config "{\"version\":\"$version\"}"

- name: Package
run: |
set -euo pipefail
tag="${{ inputs.tag || github.ref_name }}"
name="Crucible-${tag}-aarch64-apple-darwin"
mkdir -p dist
ditto -c -k --keepParent crucible-desktop/target/release/bundle/macos/Crucible.app "dist/${name}.zip"
( cd dist && shasum -a 256 "${name}.zip" > "${name}.zip.sha256" )
ls -la dist/

- name: Upload to release
if: ${{ github.ref_type == 'tag' || inputs.tag != '' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
tag="${{ inputs.tag || github.ref_name }}"
gh release create "$tag" \
--title "$tag" --generate-notes --verify-tag 2>/dev/null || true
gh release upload "$tag" dist/* --clobber
2 changes: 2 additions & 0 deletions crucible-desktop/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gen/
permissions/autogenerated/
Loading
Loading