-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
54 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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,42 +19,80 @@ 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 | ||
- 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/[email protected] | ||
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/[email protected] | ||
with: | ||
name: Binary Patcher | ||
name: Linux Binary Patcher | ||
tag_name: latest-nightly | ||
files: | | ||
target/release/Patcher | ||
target/release/Patcher.exe | ||
files: target/release/Patcher | ||
|