Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

chore: install deps using pacman (#6397)

Lucasa8a8502577b8
diff --git a/.github/workflows/docker_ci.yml b/.github/workflows/docker_ci.yml
index e91a82af16..d6b52fc94e 100644
--- a/.github/workflows/docker_ci.yml
+++ b/.github/workflows/docker_ci.yml
@@ -2,18 +2,10 @@ name: Docker-CI
on:
push:
- branches:
- - main
- - release/*
- paths:
- - frontend/**
+ branches: ["main", "release/*"]
pull_request:
- branches:
- - main
- - release/*
- paths:
- - frontend/**
- types: [ opened, synchronize, reopened, unlocked, ready_for_review ]
+ branches: ["main", "release/*"]
+ workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -27,25 +19,28 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v4
- - name: Set up Docker Compose
- run: |
- docker-compose --version || {
- echo "Docker Compose not found, installing..."
- sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- sudo chmod +x /usr/local/bin/docker-compose
- docker-compose --version
- }
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+
+ # cache the docker layers
+ - name: Cache Docker layers
+ uses: actions/cache@v3
+ with:
+ path: /tmp/.buildx-cache
+ key: ${{ runner.os }}-buildx-${{ github.sha }}
+ restore-keys: |
+ ${{ runner.os }}-buildx-
- name: Build the app
- shell: bash
+ uses: docker/build-push-action@v5
+ with:
+ context: .
+ file: ./frontend/scripts/docker-buildfiles/Dockerfile
+ push: false
+ cache-from: type=local,src=/tmp/.buildx-cache
+ cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
+
+ - name: Move cache
run: |
- set -eu -o pipefail
- cd frontend/scripts/docker-buildfiles
- docker-compose build --no-cache --progress=plain \
- | while read line; do \
- if [[ "$line" =~ ^Step[[:space:]] ]]; then \
- echo "$(date -u '+%H:%M:%S') | $line"; \
- else \
- echo "$line"; \
- fi; \
- done
+ rm -rf /tmp/.buildx-cache
+ mv /tmp/.buildx-cache-new /tmp/.buildx-cache
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 63d0432061..74de877f4e 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -232,10 +232,10 @@ jobs:
matrix:
job:
- {
- targets: "aarch64-apple-darwin,x86_64-apple-darwin",
- os: macos-latest,
- extra-build-args: "",
- }
+ targets: "aarch64-apple-darwin,x86_64-apple-darwin",
+ os: macos-latest,
+ extra-build-args: "",
+ }
steps:
- name: Checkout source code
uses: actions/checkout@v4
@@ -336,12 +336,12 @@ jobs:
matrix:
job:
- {
- arch: x86_64,
- target: x86_64-unknown-linux-gnu,
- os: ubuntu-20.04,
- extra-build-args: "",
- flutter_profile: production-linux-x86_64,
- }
+ arch: x86_64,
+ target: x86_64-unknown-linux-gnu,
+ os: ubuntu-20.04,
+ extra-build-args: "",
+ flutter_profile: production-linux-x86_64,
+ }
steps:
- name: Checkout source code
uses: actions/checkout@v4
diff --git a/frontend/scripts/docker-buildfiles/Dockerfile b/frontend/scripts/docker-buildfiles/Dockerfile
index 9c58568a66..0c2636d7c5 100644
--- a/frontend/scripts/docker-buildfiles/Dockerfile
+++ b/frontend/scripts/docker-buildfiles/Dockerfile
@@ -17,39 +17,29 @@ ENV PATH="/home/$user/.pub-cache/bin:/home/$user/flutter/bin:/home/$user/flutter
USER $user
WORKDIR /home/$user
-# Install yay
-RUN sudo pacman -S --needed --noconfirm curl tar
-RUN curl -sSfL \
- --output yay.tar.gz \
- https://github.com/Jguer/yay/releases/download/v12.3.3/yay_12.3.3_x86_64.tar.gz && \
- tar -xf yay.tar.gz && \
- sudo mv yay_12.3.3_x86_64/yay /bin && \
- rm -rf yay_12.3.3_x86_64 && \
- yay --version
-
-# Install Rust
-RUN yay -S --noconfirm curl base-devel openssl clang cmake ninja pkg-config xdg-user-dirs
+# Install Rust and dependencies using pacman
+RUN sudo pacman -S --needed --noconfirm curl base-devel openssl clang cmake ninja pkg-config xdg-user-dirs
RUN xdg-user-dirs-update
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN source ~/.cargo/env && \
- rustup toolchain install 1.77.2 && \
- rustup default 1.77.2
+ rustup toolchain install 1.80.1 && \
+ rustup default 1.80.1
# Install Flutter
RUN sudo pacman -S --noconfirm git tar gtk3
RUN curl -sSfL \
- --output flutter.tar.xz \
- https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.22.0-stable.tar.xz && \
+ --output flutter.tar.xz \
+ https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.22.0-stable.tar.xz && \
tar -xf flutter.tar.xz && \
rm flutter.tar.xz
RUN flutter config --enable-linux-desktop
RUN flutter doctor
RUN dart pub global activate protoc_plugin 21.1.2
-# Install build dependencies for AppFlowy
-RUN yay -S --noconfirm jemalloc4 cargo-make cargo-binstall
-RUN sudo pacman -S --noconfirm git libkeybinder3 sqlite clang rsync libnotify rocksdb zstd mpv
+# Install build dependencies for AppFlowy using pacman
+RUN sudo pacman -S --needed --noconfirm jemalloc git libkeybinder3 sqlite clang rsync libnotify rocksdb zstd mpv
RUN sudo ln -s /usr/bin/sha1sum /usr/bin/shasum
+RUN source ~/.cargo/env && cargo install cargo-make cargo-binstall
RUN source ~/.cargo/env && cargo binstall duckscript_cli -y
# Build AppFlowy