diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml new file mode 100644 index 00000000..f8be4e3c --- /dev/null +++ b/.forgejo/workflows/ci.yml @@ -0,0 +1,54 @@ +# bun run ci on every push to main and every pull request into main: adapters, desktop version, tests, typecheck, +# desktop i18n / typecheck / build, desktop Rust tests and clippy, scrub. Runs on the VDS runner (docs/desktop-release.md). +# Publishes nothing: site/ is still published by Jenkins. +name: ci + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +env: + BUN_VERSION: '1.4.0' + CARGO_TERM_COLOR: never + CARGO_INCREMENTAL: '0' + +jobs: + ci: + # runner label: ubuntu-22.04:docker://ghcr.io/catthehacker/ubuntu:act-22.04 + runs-on: ubuntu-22.04 + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: System packages (Tauri on Linux) + run: | + sudo apt-get update -qq + sudo apt-get install -y -qq --no-install-recommends libwebkit2gtk-4.1-dev libgtk-3-dev \ + libayatana-appindicator3-dev librsvg2-dev libsoup-3.0-dev libjavascriptcoregtk-4.1-dev libssl-dev libxdo-dev \ + build-essential curl unzip pkg-config >/dev/null + - uses: actions/cache@v4 + with: + path: | + ~/.bun/install/cache + ~/.cargo/registry/index + ~/.cargo/registry/cache + ~/.cargo/git/db + apps/desktop/src-tauri/target + key: ci-${{ runner.os }}-${{ hashFiles('bun.lock', 'apps/desktop/src-tauri/Cargo.lock') }} + restore-keys: ci-${{ runner.os }}- + - name: Bun and Rust + run: | + P="${FORGEJO_PATH:-$GITHUB_PATH}" + curl -fsSL https://bun.sh/install | bash -s "bun-v${BUN_VERSION}" >/dev/null + echo "$HOME/.bun/bin" >> "$P" + command -v rustup || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --component clippy + echo "$HOME/.cargo/bin" >> "$P" + - name: Install + run: | + rustup component add clippy + bun --version && cargo --version + bun install --frozen-lockfile + - name: bun run ci + run: bun run ci diff --git a/.forgejo/workflows/desktop.yml b/.forgejo/workflows/desktop.yml index ae3e049d..11a52208 100644 --- a/.forgejo/workflows/desktop.yml +++ b/.forgejo/workflows/desktop.yml @@ -1,7 +1,9 @@ # storebound desktop: Linux (AppImage + deb) and Windows (NSIS, per user, unsigned) installers. # macOS is built, signed and notarized on the owner's Mac (tools/desktop-release.ts mac); the updater signing key # never reaches a runner: the Mac signs these installers after downloading them (tools/desktop-release.ts add). -# Runner setup (act_runner on the VDS for Linux in Docker, a Windows runner later): docs/desktop-release.md. +# Runner setup (Forgejo runner on the VDS for Linux in Docker, a Windows runner later): docs/desktop-release.md. +# Publishes nothing: the installers are workflow artifacts only (14 days); `tools/desktop-release.ts add` on the Mac +# signs and stages them, and only `publish` puts anything on storebound.dev. name: desktop on: @@ -22,7 +24,7 @@ env: jobs: linux: - # act_runner label: ubuntu-22.04:docker://ghcr.io/catthehacker/ubuntu:act-22.04 (glibc 2.35: the AppImage and the + # runner label: ubuntu-22.04:docker://ghcr.io/catthehacker/ubuntu:act-22.04 (glibc 2.35: the AppImage and the # deb then run on Ubuntu 22.04 and newer, Debian 12) runs-on: ubuntu-22.04 timeout-minutes: 90 @@ -36,16 +38,26 @@ jobs: - uses: actions/checkout@v4 - name: System packages run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev \ + sudo apt-get update -qq + sudo apt-get install -y -qq --no-install-recommends libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev \ librsvg2-dev libsoup-3.0-dev libjavascriptcoregtk-4.1-dev libssl-dev libxdo-dev patchelf file build-essential \ - curl unzip squashfs-tools p7zip-full xz-utils + curl unzip squashfs-tools p7zip-full xz-utils >/dev/null + - uses: actions/cache@v4 + with: + path: | + ~/.bun/install/cache + ~/.cargo/registry/index + ~/.cargo/registry/cache + ~/.cargo/git/db + key: desktop-${{ runner.os }}-${{ hashFiles('bun.lock', 'apps/desktop/src-tauri/Cargo.lock') }} + restore-keys: desktop-${{ runner.os }}- - name: Bun and Rust run: | - curl -fsSL https://bun.sh/install | bash -s "bun-v${BUN_VERSION}" - echo "$HOME/.bun/bin" >> "$GITHUB_PATH" + P="${FORGEJO_PATH:-$GITHUB_PATH}" + curl -fsSL https://bun.sh/install | bash -s "bun-v${BUN_VERSION}" >/dev/null + echo "$HOME/.bun/bin" >> "$P" command -v rustup || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal - echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + echo "$HOME/.cargo/bin" >> "$P" - name: Install and check run: | bun install --frozen-lockfile @@ -74,7 +86,8 @@ jobs: retention-days: 14 windows: - if: ${{ inputs.windows }} + # only on a manual run with "windows" ticked (a tag push never sets it), so without a Windows runner it is skipped + if: ${{ github.event_name == 'workflow_dispatch' && inputs.windows }} # a Windows runner registered with the "windows" label (host mode): Rust (MSVC), Bun, 7-Zip runs-on: windows timeout-minutes: 90