From 7a265427b102d3321dd3f241e58f2bcd564d61ab Mon Sep 17 00:00:00 2001 From: Kavish Devar Date: Tue, 24 Feb 2026 19:04:36 +0530 Subject: [PATCH] add ci --- .github/workflows/{ci.yml => ci-android.yml} | 2 + .github/workflows/ci-linux-rust.yml | 87 ++++++++++++++++++++ .github/workflows/ci-linux.yml | 37 +++++++++ 3 files changed, 126 insertions(+) rename .github/workflows/{ci.yml => ci-android.yml} (99%) create mode 100644 .github/workflows/ci-linux-rust.yml create mode 100644 .github/workflows/ci-linux.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci-android.yml similarity index 99% rename from .github/workflows/ci.yml rename to .github/workflows/ci-android.yml index b5d6b55..9d098a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci-android.yml @@ -4,6 +4,8 @@ on: push: branches: - '*' + paths: + - 'android/**' workflow_dispatch: inputs: release: diff --git a/.github/workflows/ci-linux-rust.yml b/.github/workflows/ci-linux-rust.yml new file mode 100644 index 0000000..8766299 --- /dev/null +++ b/.github/workflows/ci-linux-rust.yml @@ -0,0 +1,87 @@ +name: Linux Build & Release + +on: + push: + branches: + - linux/rust + tags: + - 'linux-v*' + paths: + - 'linux-rust/**' + - '.github/workflows/linux-build.yml' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y pkg-config libdbus-1-dev libpulse-dev appstream just libfuse2 + + - name: Install AppImage tools + run: | + wget -q https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool + wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -O /usr/local/bin/linuxdeploy + chmod +x /usr/local/bin/{appimagetool,linuxdeploy} + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Cache Cargo + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + linux-rust/target + key: ${{ runner.os }}-cargo-${{ hashFiles('linux-rust/Cargo.lock') }} + + - name: Build AppImage and Binary + working-directory: linux-rust + run: | + cargo build --release --verbose + just + mkdir -p dist + cp target/release/librepods dist/librepods + mv dist/LibrePods-x86_64.AppImage dist/librepods-x86_64.AppImage + + - name: Upload AppImage artifact + if: "!startsWith(github.ref, 'refs/tags/linux-v')" + uses: actions/upload-artifact@v4 + with: + name: librepods-x86_64.AppImage + path: linux-rust/dist/librepods-x86_64.AppImage + + - name: Upload binary artifact + if: "!startsWith(github.ref, 'refs/tags/linux-v')" + uses: actions/upload-artifact@v4 + with: + name: librepods + path: linux-rust/dist/librepods + + - name: Create tarball for Flatpak + if: startsWith(github.ref, 'refs/tags/linux-v') + working-directory: linux-rust + run: | + VERSION="${GITHUB_REF_NAME#linux-v}" + just tarball "${VERSION}" + echo "VERSION=${VERSION}" >> $GITHUB_ENV + echo "TAR_PATH=linux-rust/dist/librepods-v${VERSION}-source.tar.gz" >> $GITHUB_ENV + + - name: Create GitHub Release (AppImage + binary + source) + if: startsWith(github.ref, 'refs/tags/linux-v') + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.ref_name }} + files: | + linux-rust/dist/librepods-v${{ env.VERSION }}-source.tar.gz + linux-rust/dist/librepods-x86_64.AppImage + linux-rust/dist/librepods + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml new file mode 100644 index 0000000..a26b3ba --- /dev/null +++ b/.github/workflows/ci-linux.yml @@ -0,0 +1,37 @@ +name: Build LibrePods Linux + +on: + workflow_dispatch: +# push: +# branches: +# - '*' + +jobs: + build-linux: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential cmake ninja-build \ + qt6-base-dev qt6-declarative-dev qt6-svg-dev \ + qt6-tools-dev qt6-tools-dev-tools qt6-connectivity-dev \ + libxkbcommon-dev + + - name: Build project + working-directory: linux + run: | + mkdir build + cd build + cmake .. -G Ninja + ninja + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: librepods-linux + path: linux/build/librepods