From d2283a4deff778c70d7a2cbd6976fbed4a180207 Mon Sep 17 00:00:00 2001 From: Abdenasser Date: Thu, 7 Nov 2024 17:29:27 +0100 Subject: [PATCH] separating linux workflows --- .github/workflows/linux-aarch64-nightly.yml | 85 +++++++++++++ .github/workflows/linux-nightly.yml | 125 -------------------- .github/workflows/linux-x86_64-nightly.yml | 80 +++++++++++++ 3 files changed, 165 insertions(+), 125 deletions(-) create mode 100644 .github/workflows/linux-aarch64-nightly.yml delete mode 100644 .github/workflows/linux-nightly.yml create mode 100644 .github/workflows/linux-x86_64-nightly.yml diff --git a/.github/workflows/linux-aarch64-nightly.yml b/.github/workflows/linux-aarch64-nightly.yml new file mode 100644 index 0000000..bc7e9a0 --- /dev/null +++ b/.github/workflows/linux-aarch64-nightly.yml @@ -0,0 +1,85 @@ +name: Linux (aarch64) Nightly Build + +on: + workflow_dispatch: # Allows manual triggering + schedule: + - cron: '0 0 * * *' # Run daily at midnight UTC + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + name: Build Linux aarch64 Packages + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 'lts/*' + cache: 'npm' + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + targets: aarch64-unknown-linux-gnu + + - name: Install Linux Dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + pkg-config \ + gcc-aarch64-linux-gnu \ + g++-aarch64-linux-gnu \ + libgtk-3-dev \ + libayatana-appindicator3-dev \ + librsvg2-dev \ + libglib2.0-dev \ + libjavascriptcoregtk-4.0-dev \ + libsoup-3.0-dev \ + libwebkit2gtk-4.1-dev + + - name: Install Dependencies + run: npm install + + - name: Build Frontend + run: npm run build + + - name: Build AppImage + run: | + echo "Building AppImage for aarch64..." + npm run tauri build -- --target aarch64-unknown-linux-gnu --bundles appimage + + - name: Build Debian Package + run: | + echo "Building Debian package for aarch64..." + npm run tauri build -- --target aarch64-unknown-linux-gnu --bundles deb + + - name: Upload AppImage + uses: actions/upload-artifact@v4 + with: + name: linux-appimage-aarch64 + path: src-tauri/target/aarch64-unknown-linux-gnu/release/bundle/appimage/*.AppImage + + - name: Upload Debian Package + uses: actions/upload-artifact@v4 + with: + name: linux-deb-aarch64 + path: src-tauri/target/aarch64-unknown-linux-gnu/release/bundle/deb/*.deb + + - name: Create Release + if: github.event_name == 'schedule' # Only create release for scheduled builds + uses: softprops/action-gh-release@v1 + with: + name: Linux ARM64 Nightly Build ${{ github.sha }} + tag_name: linux-arm64-nightly-${{ github.sha }} + files: | + src-tauri/target/aarch64-unknown-linux-gnu/release/bundle/appimage/*.AppImage + src-tauri/target/aarch64-unknown-linux-gnu/release/bundle/deb/*.deb + prerelease: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/linux-nightly.yml b/.github/workflows/linux-nightly.yml deleted file mode 100644 index 2085555..0000000 --- a/.github/workflows/linux-nightly.yml +++ /dev/null @@ -1,125 +0,0 @@ -name: Linux (x86_64, aarch64) Nightly Build - -on: - workflow_dispatch: # Allows manual triggering - -env: - CARGO_TERM_COLOR: always - -jobs: - build: - name: Build Linux Packages - runs-on: ubuntu-latest - strategy: - matrix: - target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu] - - steps: - - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 'lts/*' - cache: 'npm' - - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - - - name: Add Target - run: rustup target add ${{ matrix.target }} - - - name: Install Cross-Compilation Tools - if: matrix.target == 'aarch64-unknown-linux-gnu' - run: | - sudo dpkg --add-architecture arm64 - # Remove existing sources to prevent 404 errors - sudo rm -f /etc/apt/sources.list.d/*.list - # Add ARM64 repositories - sudo tee /etc/apt/sources.list.d/arm64.list << EOF - deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse - deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted universe multiverse - deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security main restricted universe multiverse - EOF - # Add amd64 repositories - sudo tee /etc/apt/sources.list.d/amd64.list << EOF - deb [arch=amd64] http://archive.ubuntu.com/ubuntu jammy main restricted universe multiverse - deb [arch=amd64] http://archive.ubuntu.com/ubuntu jammy-updates main restricted universe multiverse - deb [arch=amd64] http://archive.ubuntu.com/ubuntu jammy-security main restricted universe multiverse - EOF - sudo apt-get update - sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - # Install ARM64 versions of GTK and related dependencies - sudo apt-get install -y \ - libgtk-3-dev:arm64 \ - libayatana-appindicator3-dev:arm64 \ - librsvg2-dev:arm64 \ - libglib2.0-dev:arm64 \ - libjavascriptcoregtk-4.0-dev:arm64 \ - libsoup-3.0-dev:arm64 \ - libwebkit2gtk-4.1-dev:arm64 - - - name: Configure Cross-Compilation Environment - if: matrix.target == 'aarch64-unknown-linux-gnu' - run: | - echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV - echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV - echo "PKG_CONFIG_SYSROOT_DIR=/" >> $GITHUB_ENV - # Use regular pkg-config instead of the arm64-specific one - echo "PKG_CONFIG=pkg-config" >> $GITHUB_ENV - - - name: Install Linux Dependencies - run: | - sudo apt-get update - sudo apt-get install -y \ - build-essential \ - pkg-config \ - libgtk-3-dev \ - libayatana-appindicator3-dev \ - librsvg2-dev \ - libglib2.0-dev \ - libjavascriptcoregtk-4.0-dev \ - libsoup-3.0-dev \ - libwebkit2gtk-4.1-dev - - - name: Install Dependencies - run: | - npm install - - - name: Build Frontend - run: npm run build - - - name: Build AppImage (${{ matrix.target }}) - run: | - echo "Building AppImage for ${{ matrix.target }}..." - npm run tauri build -- --target ${{ matrix.target }} --bundles appimage - - - name: Build Debian Package (${{ matrix.target }}) - run: | - echo "Building Debian package for ${{ matrix.target }}..." - npm run tauri build -- --target ${{ matrix.target }} --bundles deb - - - name: Upload AppImage - uses: actions/upload-artifact@v4 - with: - name: linux-appimage-${{ matrix.target }} - path: src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage - - - name: Upload Debian Package - uses: actions/upload-artifact@v4 - with: - name: linux-deb-${{ matrix.target }} - path: src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb - - - name: Create Release - if: github.event_name == 'schedule' - uses: softprops/action-gh-release@v1 - with: - name: Linux Nightly Build ${{ github.sha }} - tag_name: linux-nightly-${{ github.sha }} - files: | - src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage - src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb - prerelease: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/linux-x86_64-nightly.yml b/.github/workflows/linux-x86_64-nightly.yml new file mode 100644 index 0000000..cb5ae14 --- /dev/null +++ b/.github/workflows/linux-x86_64-nightly.yml @@ -0,0 +1,80 @@ +name: Linux (x86_64) Nightly Build + +on: + workflow_dispatch: # Allows manual triggering + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + name: Build Linux Packages + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 'lts/*' + cache: 'npm' + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Install Linux Dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + pkg-config \ + libgtk-3-dev \ + libayatana-appindicator3-dev \ + librsvg2-dev \ + libglib2.0-dev \ + libjavascriptcoregtk-4.0-dev \ + libsoup-3.0-dev \ + libwebkit2gtk-4.1-dev + + - name: Install Dependencies + run: | + npm install + + - name: Build Frontend + run: npm run build + + - name: Build AppImage (x86_64) + run: | + echo "Building AppImage for x86_64..." + npm run tauri build -- --target x86_64-unknown-linux-gnu --bundles appimage + + - name: Build Debian Package (x86_64) + run: | + echo "Building Debian package for x86_64..." + npm run tauri build -- --target x86_64-unknown-linux-gnu --bundles deb + + - name: Upload AppImage + uses: actions/upload-artifact@v4 + with: + name: linux-appimage + path: src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage + + - name: Upload Debian Package + uses: actions/upload-artifact@v4 + with: + name: linux-deb + path: src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb + + - name: Create Release + if: github.event_name == 'schedule' # Only create release for scheduled builds + uses: softprops/action-gh-release@v1 + with: + name: Linux Nightly Build ${{ github.sha }} + tag_name: linux-nightly-${{ github.sha }} + files: | + src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage + src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb + prerelease: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file