From 43a9f8d9d47c72504eb2123cbba0fa135a3a8ff4 Mon Sep 17 00:00:00 2001 From: Veha Veha Date: Sun, 12 Jan 2025 22:53:06 +0700 Subject: [PATCH] Update ci.yml gemini --- .github/workflows/ci.yml | 76 ++++++++++++++++++++++++++++------------ 1 file changed, 54 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 962a7fc..0305f08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,19 +1,13 @@ name: CI -on: [push, pull_request] +on: [ push , pull_request ] permissions: contents: write jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest, ubuntu-latest] - target: - windows-latest: x86_64-pc-windows-msvc - ubuntu-latest: x86_64-unknown-linux-gnu + windows-build: + runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v4 @@ -25,16 +19,18 @@ jobs: ~/.cargo ~/.rustup target - key: cargo-${{ matrix.os }}-${{ hashFiles('**/Cargo.lock') }} + key: cargo-${{ hashFiles('**/Cargo.lock') }} - name: Setup Rust + shell: pwsh run: | rustup default stable - rustup target add ${{ matrix.target[matrix.os] }} + rustup target add x86_64-pc-windows-msvc rustc -vV cargo -vV - name: Build + shell: pwsh run: | cargo build cargo build --release @@ -42,25 +38,61 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: BinaryPatch-${{ matrix.os }} + name: Windows-BinaryPatch path: | - target/debug/${{ matrix.os == 'windows-latest' && 'Patcher.exe' || 'Patcher' }} - target/release/${{ matrix.os == 'windows-latest' && 'Patcher.exe' || 'Patcher' }} + target/debug/Patcher.exe + target/release/Patcher.exe if-no-files-found: error - release: - if: ${{ github.event_name == 'push' }} - needs: build + - name: Release + if: ${{ github.event_name == 'push' }} + uses: softprops/action-gh-release@v2.2.1 + with: + name: Windows Binary Patcher + tag_name: latest-nightly + files: target/release/Patcher.exe + + linux-build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - - name: Upload Release Artifacts + - name: Cargo Caches + uses: actions/cache@v4 + with: + path: | + ~/.cargo + ~/.rustup + target + key: cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Setup Rust + run: | + rustup default stable + rustup target add x86_64-unknown-linux-gnu + rustc -vV + cargo -vV + + - name: Build + run: | + cargo build + cargo build --release + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: Linux-BinaryPatch + path: | + target/debug/Patcher + target/release/Patcher + if-no-files-found: error + + - name: Release + if: ${{ github.event_name == 'push' }} uses: softprops/action-gh-release@v2.2.1 with: - name: Binary Patcher + name: Linux Binary Patcher tag_name: latest-nightly - files: | - target/release/Patcher - target/release/Patcher.exe + files: target/release/Patcher +