diff --git a/.branding b/.branding new file mode 100644 index 0000000000..7f1c9ecbe7 --- /dev/null +++ b/.branding @@ -0,0 +1,2 @@ +https://github.com/Keavon/graphite-branded-assets/archive/f44aa2f362ae4fed8d634878b817a1d3948a7dcb.tar.gz +dffe2b483e491979ef57c320d61446ada5400ef73ff26582976631d9c36efefc diff --git a/.cargo/config.toml b/.cargo/config.toml index 4087f77f96..b6ad2fee27 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -10,3 +10,6 @@ rustflags = [ "link-arg=--max-memory=4294967296", "--cfg=web_sys_unstable_apis", ] + +[env] +CARGO_WORKSPACE_DIR = { value = "", relative = true } diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6b4ee383f2..bddfffaf1f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -23,7 +23,6 @@ "streetsidesoftware.code-spell-checker", // Helpful "mhutchie.git-graph", - "waderyan.gitblame", "qezhu.gitlink", "wmaurer.change-case" ] diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 4662c5521a..b758bce647 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,3 +1,13 @@ - + diff --git a/.github/workflows/build-dev-and-ci.yml b/.github/workflows/build-dev-and-ci.yml index 016d42cbb3..c903568c0b 100644 --- a/.github/workflows/build-dev-and-ci.yml +++ b/.github/workflows/build-dev-and-ci.yml @@ -5,9 +5,10 @@ on: branches: - master pull_request: {} + merge_group: {} env: CARGO_TERM_COLOR: always - INDEX_HTML_HEAD_REPLACEMENT: + INDEX_HTML_HEAD_REPLACEMENT: jobs: build: @@ -34,10 +35,10 @@ jobs: with: node-version: "latest" - - name: ๐ง Install Node dependencies + - name: ๐ง Install build dependencies run: | cd frontend - npm ci + npm run setup - name: ๐ฆ Install the latest Rust run: | @@ -47,6 +48,11 @@ jobs: echo "Latest updated version:" rustc --version + - name: ๐ฆ Fetch Rust dependencies + run: | + echo "If it fails here, the committed Cargo.lock may be out of date" + cargo fetch --locked + - name: โ Replace template in
of index.html run: | # Remove the INDEX_HTML_HEAD_REPLACEMENT environment variable for build links (not master deploys) @@ -103,14 +109,16 @@ jobs: - name: ๐งช Run Rust tests run: | - mold -run cargo test --all-features --workspace + mold -run cargo test --all-features - name: ๐ Generate code documentation info for website if: github.ref == 'refs/heads/master' run: | - cargo test --package graphite-editor --lib -- messages::message::test::generate_message_tree + cd tools/editor-message-tree + cargo run + cd ../.. mkdir -p artifacts-generated - mv hierarchical_message_system_tree.txt artifacts-generated/hierarchical_message_system_tree.txt + mv website/generated/hierarchical_message_system_tree.txt artifacts-generated/hierarchical_message_system_tree.txt - name: ๐ฟ Obtain cache of auto-generated code docs artifacts, to check if they've changed if: github.ref == 'refs/heads/master' diff --git a/.github/workflows/build-linux-bundle.yml b/.github/workflows/build-linux-bundle.yml new file mode 100644 index 0000000000..4b07e490b2 --- /dev/null +++ b/.github/workflows/build-linux-bundle.yml @@ -0,0 +1,59 @@ +name: Build Linux Bundle + +on: + workflow_dispatch: {} + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + + - name: Free disk space + run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache + + - name: Build Linux Bundle + run: nix build .nix#graphite-bundle.tar.xz && cp ./result ./graphite-linux-bundle.tar.xz + + - name: Upload Linux Bundle + uses: actions/upload-artifact@v4 + with: + name: graphite-linux-bundle + path: graphite-linux-bundle.tar.xz + compression-level: 0 + + - name: Setup Flatpak Tooling + run: | + sudo apt-get update + sudo apt-get install -y flatpak flatpak-builder + flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + + - name: Build Flatpak + run: | + nix build .nix#graphite-flatpak-manifest + + rm -rf .flatpak + mkdir -p .flatpak + + cp ./result .flatpak/manifest.json + + cd .flatpak + mkdir -p repo + + flatpak-builder --user --force-clean --install-deps-from=flathub --repo=repo build ./manifest.json + + flatpak build-bundle repo graphite.flatpak art.graphite.Graphite --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo + + - name: Upload Flatpak + uses: actions/upload-artifact@v4 + with: + name: graphite-flatpak + path: .flatpak/graphite.flatpak + compression-level: 0 diff --git a/.github/workflows/build-mac-bundle.yml b/.github/workflows/build-mac-bundle.yml new file mode 100644 index 0000000000..ee6d1bbb3b --- /dev/null +++ b/.github/workflows/build-mac-bundle.yml @@ -0,0 +1,153 @@ +name: Build Mac Bundle + +on: + push: + branches: + - master + +jobs: + build: + runs-on: macos-latest + + env: + WASM_BINDGEN_CLI_VERSION: "0.2.100" + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + override: true + rustflags: "" + target: wasm32-unknown-unknown + + - name: Cache Cargo + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: npm + cache-dependency-path: | + package-lock.json + frontend/package-lock.json + + - name: Install Native Dependencies + env: + GITHUB_TOKEN: ${{ github.token }} + BINSTALL_DISABLE_TELEMETRY: "true" + run: | + brew update + brew install \ + pkg-config \ + openssl@3 \ + binaryen \ + llvm \ + cargo-binstall + + echo "OPENSSL_DIR=$(brew --prefix openssl@3)" >> $GITHUB_ENV + echo "PKG_CONFIG_PATH=$(brew --prefix openssl@3)/lib/pkgconfig" >> $GITHUB_ENV + echo "$(brew --prefix llvm)/bin" >> $GITHUB_PATH + + cargo binstall --no-confirm --force wasm-pack + cargo binstall --no-confirm --force cargo-about + cargo binstall --no-confirm --force "wasm-bindgen-cli@${WASM_BINDGEN_CLI_VERSION}" + + - name: Build Mac Bundle + env: + CARGO_TERM_COLOR: always + run: npm run build-desktop + + - name: Stage Artifacts + shell: bash + run: | + rm -rf target/artifacts + mkdir -p target/artifacts + cp -R target/release/Graphite.app target/artifacts/Graphite.app + + - name: Upload Mac Bundle + uses: actions/upload-artifact@v4 + with: + name: graphite-mac-bundle + path: target/artifacts + + - name: Sign and Notarize Mac Bundle Preparation + env: + APPLE_CERT_BASE64: ${{ secrets.APPLE_CERT_BASE64 }} + APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }} + run: | + mkdir -p .sign + echo "$APPLE_CERT_BASE64" | base64 --decode > .sign/certificate.p12 + + security create-keychain -p "" .sign/main.keychain + security default-keychain -s .sign/main.keychain + security unlock-keychain -p "" .sign/main.keychain + security set-keychain-settings -t 3600 -u .sign/main.keychain + + security import .sign/certificate.p12 -k .sign/main.keychain -P "$APPLE_CERT_PASSWORD" -T /usr/bin/codesign -T /usr/bin/productsign + security set-key-partition-list -S apple-tool:,apple: -s -k "" .sign/main.keychain + + cat > .sign/entitlements.plist <<'EOF' + + +