diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 077adf6..4ccedc3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ on: workflow_dispatch: jobs: - build: + build-desktop: strategy: fail-fast: false matrix: @@ -105,3 +105,131 @@ jobs: path: | src-tauri/target/release/bundle/msi/*.msi src-tauri/target/release/bundle/nsis/*.exe + + build-android: + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + + - name: Setup Android SDK + uses: android-actions/setup-android@v3 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Install Rust Android targets + run: | + rustup target add aarch64-linux-android + rustup target add armv7-linux-androideabi + rustup target add i686-linux-android + rustup target add x86_64-linux-android + + - name: Setup NDK + uses: nttld/setup-ndk@v1 + with: + ndk-version: r26d + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - name: Setup pnpm cache + uses: actions/cache@v4 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Setup Rust cache + uses: Swatinem/rust-cache@v2 + with: + workspaces: src-tauri + + - name: Install frontend dependencies + run: pnpm install --frozen-lockfile + + - name: Build Android APK + run: pnpm tauri android build --apk + + - name: Build Android AAB + run: pnpm tauri android build --aab + + - name: Upload Android artifacts + uses: actions/upload-artifact@v4 + with: + name: android + path: | + src-tauri/gen/android/app/build/outputs/apk/**/*.apk + src-tauri/gen/android/app/build/outputs/bundle/**/*.aab + + build-ios: + runs-on: macos-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Install Rust iOS targets + run: | + rustup target add aarch64-apple-ios + rustup target add x86_64-apple-ios + rustup target add aarch64-apple-ios-sim + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - name: Setup pnpm cache + uses: actions/cache@v4 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Setup Rust cache + uses: Swatinem/rust-cache@v2 + with: + workspaces: src-tauri + + - name: Install frontend dependencies + run: pnpm install --frozen-lockfile + + - name: Build iOS app + run: pnpm tauri ios build + + - name: Upload iOS artifacts + uses: actions/upload-artifact@v4 + with: + name: ios + path: | + src-tauri/gen/apple/build/Build/Products/**/*.app + src-tauri/gen/apple/build/Build/Products/**/*.ipa diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 481e595..a1b1ca7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,7 +42,7 @@ jobs: }) return data.id - build-tauri: + build-desktop: needs: create-release permissions: contents: write @@ -112,11 +112,145 @@ jobs: releaseId: ${{ needs.create-release.outputs.release_id }} args: ${{ matrix.args }} + build-android: + needs: create-release + permissions: + contents: write + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + + - name: Setup Android SDK + uses: android-actions/setup-android@v3 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Install Rust Android targets + run: | + rustup target add aarch64-linux-android + rustup target add armv7-linux-androideabi + rustup target add i686-linux-android + rustup target add x86_64-linux-android + + - name: Setup NDK + uses: nttld/setup-ndk@v1 + with: + ndk-version: r26d + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - name: Setup pnpm cache + uses: actions/cache@v4 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Setup Rust cache + uses: Swatinem/rust-cache@v2 + with: + workspaces: src-tauri + + - name: Install frontend dependencies + run: pnpm install --frozen-lockfile + + - name: Build Android APK + run: pnpm tauri android build --apk + + - name: Build Android AAB + run: pnpm tauri android build --aab + + - name: Upload to Release + uses: softprops/action-gh-release@v2 + with: + files: | + src-tauri/gen/android/app/build/outputs/apk/**/*.apk + src-tauri/gen/android/app/build/outputs/bundle/**/*.aab + draft: true + + build-ios: + needs: create-release + permissions: + contents: write + runs-on: macos-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Install Rust iOS targets + run: | + rustup target add aarch64-apple-ios + rustup target add x86_64-apple-ios + rustup target add aarch64-apple-ios-sim + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - name: Setup pnpm cache + uses: actions/cache@v4 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Setup Rust cache + uses: Swatinem/rust-cache@v2 + with: + workspaces: src-tauri + + - name: Install frontend dependencies + run: pnpm install --frozen-lockfile + + - name: Build iOS app + run: pnpm tauri ios build + + - name: Upload to Release + uses: softprops/action-gh-release@v2 + with: + files: | + src-tauri/gen/apple/build/Build/Products/**/*.app + src-tauri/gen/apple/build/Build/Products/**/*.ipa + draft: true + publish-release: permissions: contents: write runs-on: ubuntu-22.04 - needs: [create-release, build-tauri] + needs: [create-release, build-desktop, build-android, build-ios] steps: - name: Publish release