Skip to content

Commit

Permalink
fixedq
Browse files Browse the repository at this point in the history
  • Loading branch information
Veha0001 committed Jan 6, 2025
1 parent 2a7d4f5 commit 097d914
Showing 1 changed file with 47 additions and 44 deletions.
91 changes: 47 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,50 @@ jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore cache
uses: actions/cache/restore@v4
with:
path: |
~/.cargo
~/.rustup
target
key: cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Setup Rust
run: |
rustup toolchain default stable
rustup target add x86_64-pc-windows-msvc
rustc -vV
cargo -vV

- name: Build
run: |
if [ "${{ github.ref_type }}" == "tag" ]; then
export DRS_BUILD_VERSION_OVERRIDE="${{ github.ref_name }}"
elif [ "${{ github.ref_name }}" == "master" ]; then
export DRS_BUILD_VERSION_OVERRIDE="${{ env.VERSION }}-$((${{ github.run_number }} + 654))"
else
export DRS_BUILD_VERSION_OVERRIDE="${{ env.VERSION }}-${GITHUB_SHA:0:7}"
fi
CARGO_INCREMENTAL=1 cargo build --release

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: BinaryPatch
path: target/release/patcher.exe
if-no-files-found: error

- name: Save cache
uses: actions/cache/save@v4
with:
path: |
~/.cargo
~/.rustup
target
key: cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Checkout
uses: actions/checkout@v4

- name: Restore cache
uses: actions/cache/restore@v4
with:
path: |
~/.cargo
~/.rustup
target
key: cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Setup Rust
run: |
rustup default stable
rustup target add x86_64-pc-windows-msvc
rustc -vV
cargo -vV
- name: Build
env:
VERSION: "1.0.0" # Replace with your default version
run: |
if [ "${{ github.ref_type }}" == "tag" ]; then
export DRS_BUILD_VERSION_OVERRIDE="${{ github.ref_name }}"
elif [ "${{ github.ref_name }}" == "master" ]; then
export DRS_BUILD_VERSION_OVERRIDE="${{ env.VERSION }}-$((${{ github.run_number }} + 654))"
else
export DRS_BUILD_VERSION_OVERRIDE="${{ env.VERSION }}-${GITHUB_SHA:0:7}"
fi
CARGO_INCREMENTAL=1 cargo build --release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: BinaryPatch
path: target/release/patcher.exe
if-no-files-found: error

- name: Save cache
uses: actions/cache/save@v4
with:
path: |
~/.cargo
~/.rustup
target
key: cargo-${{ hashFiles('**/Cargo.lock') }}

0 comments on commit 097d914

Please sign in to comment.