Skip to content

Commit

Permalink
Merge branch 'main' into window-doc
Browse files Browse the repository at this point in the history
  • Loading branch information
wusyong authored Sep 30, 2024
2 parents c43e290 + 934ff76 commit 8bdc047
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 47 deletions.
78 changes: 33 additions & 45 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,35 @@ on:

jobs:
build:
runs-on: ubuntu-latest
env:
RUSTC_WRAPPER: sccache
CCACHE: sccache
SCCACHE_GHA_ENABLED: 'true'
LIBCLANG_PATH: /usr/lib/llvm-14/lib
runs-on: ubuntu-24.04
permissions:
actions: write # for purging
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Run sccache-cache
uses: Mozilla-Actions/[email protected]
- uses: actions/checkout@v4
- uses: nixbuild/nix-quick-install-action@v28

- name: Configure cache
uses: Swatinem/rust-cache@v2

- name: Install Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Setup Nix Shell
uses: rrbutani/use-nix-shell-action@v1
- name: "Restore and cache Nix store"
uses: nix-community/cache-nix-action@v5
with:
file: shell.nix
paths: |
~/.cargo
target/debug/
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', 'Cargo.lock', 'Cargo.toml') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
gc-max-store-size-linux: 1073741824

- name: Clean docs folder
run: cargo clean --doc
- name: "Add Nix channel"
run: |
nix-channel --add https://nixos.org/channels/nixos-24.05 nixpkgs
nix-channel --update nixpkgs
- name: Build docs
run: cargo doc -p verso --no-deps
- name: "Build Verso docs"
run: nix-shell shell.nix --run 'cargo doc -p verso --no-deps'

- name: Remove lock file
- name: "Remove doc lock file"
run: rm target/doc/.lock

- name: Upload `doc`
- name: "Upload `doc` artifact"
uses: actions/upload-artifact@v4
with:
name: doc
Expand All @@ -54,33 +47,28 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout `docs` repository
- name: "Checkout `docs` repository"
uses: actions/checkout@v4
with:
repository: versotile-org/docs.versotile.org
repository: versotile-org/www-docs
ssh-key: ${{ secrets.DOCS_DEPLOY_KEY }}
ref: docs

- name: Clean up docs directory
run: |
cp {docs/,}index.html
rm -r docs/*
mv index.html docs/
cp CNAME docs/
- name: Download `doc`
- name: "Download `doc` artifact"
uses: actions/download-artifact@v4
with:
name: doc
path: docs
path: artifact

- name: Configure Git
- name: "Configure git, commit changes and PUSH"
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Commit and push
run: |
git add docs
git commit -m ":rocket: update docs from \`verso\` repository"
rm -r docs/*
cp -r artifact/* docs/
git add docs/
git fetch origin main:main
git checkout main docs/
git status
git commit -m ":rocket: update docs from \`verso\` repository" || exit 0
git push origin docs
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,21 @@ cargo run
For unified environment setup and package experience, we choose Flatpak to build the project from the start.
Please follow the [Flatpak Setup](https://flatpak.org/setup/) page to install Flatpak based on your distribution.

- Install flatpak runtimes and extensions:

```sh
flatpak install flathub org.freedesktop.Platform//23.08
flatpak install flathub org.freedesktop.Sdk//23.08
flatpak install flathub org.freedesktop.Sdk.Extension.rust-stable//23.08
flatpak install flathub org.freedesktop.Sdk.Extension.llvm18//23.08
```

- Generate manifests and build:
// TODO Exporting to a repository instead

```sh
python3 ./flatpak-cargo-generator.py ./Cargo.lock -o cargo-sources.json
flatpak-builder --user --install --install-deps-from=flathub --force-clean target org.versotile.verso.yml
flatpak-builder --user --install --force-clean target org.versotile.verso.yml
flatpak run org.versotile.verso
```

Expand All @@ -88,7 +96,7 @@ But please understand we don't triage any build issue without flatpak or nix set

Nightly releases built with CrabNebula Cloud can be found at [releases](https://web.crabnebula.cloud/verso/verso-nightly/releases).

> Packages are unsigned currently. If you have problem opening the app on macOS, try `xattr -d com.apple.quarantine /Applications/verso.app` after installation.
> Packages are unsigned currently. If you have problem opening the app on macOS, try `xattr -d com.apple.quarantine /Applications/verso.app` after installation.
## Future Work

Expand Down

0 comments on commit 8bdc047

Please sign in to comment.