-
Notifications
You must be signed in to change notification settings - Fork 38
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
4 changed files
with
107 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: ["*.*.x"] | ||
pull_request: | ||
branches: ["*.*.x"] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
check-format: | ||
name: Check formatting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: rustup toolchain install nightly --profile minimal --component rustfmt --no-self-update | ||
- run: cargo +nightly fmt --all -- --check | ||
|
||
lint: | ||
name: Lint | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: rustup toolchain install stable --profile minimal --component clippy --no-self-update | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: "debug" | ||
cache-on-failure: true | ||
- run: cargo clippy --all-features -- -D warnings | ||
|
||
test: | ||
name: Test | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: rustup toolchain install stable --profile minimal --no-self-update | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: "debug" | ||
cache-on-failure: true | ||
- run: cargo test --all-features | ||
|
||
build: | ||
name: Build | ||
runs-on: windows-latest | ||
env: | ||
ARCHIVE_NAME: redscript-${{ github.ref_name }}.zip | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: rustup toolchain install stable --profile minimal --no-self-update | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: "release" | ||
- run: cargo build --release | ||
- run: .\build\package.ps1 -zipPath ${{ env.ARCHIVE_NAME }} | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: | | ||
${{ env.ARCHIVE_NAME }} | ||
target/release/redscript-cli.exe | ||
if-no-files-found: error |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[Scripts] | ||
EnableCompilation = "true" |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[args] | ||
scriptsBlobPath = "{game_dir}\\r6\\cache\\modded\\final.redscripts" | ||
|
||
[[tasks]] | ||
command = "InvokeScc" | ||
path = "{game_dir}\\r6\\scripts" | ||
custom_cache_dir = "{game_dir}\\r6\\cache\\modded" | ||
terminate_on_errors = false |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
param ( | ||
[string]$zipPath | ||
) | ||
|
||
if (-not $zipPath) { | ||
Write-Error "No output path provided. Please provide a path to write the zip archive to." | ||
exit 1 | ||
} | ||
|
||
if (-not (Test-Path "target/release/scc.exe")) { | ||
Write-Error "scc.exe not found in target/release. Please ensure you have built it." | ||
exit 1 | ||
} | ||
|
||
if ($env:RUNNER_TEMP) { | ||
$tempDir = $env:RUNNER_TEMP | ||
} else { | ||
$tempDir = $env:TEMP | ||
} | ||
|
||
$stagingDir = Join-Path $tempDir "redscript-archive" | ||
if (Test-Path $stagingDir) { | ||
Remove-Item -Recurse -Force $stagingDir | ||
} | ||
|
||
New-Item -ItemType Directory -Path $stagingDir | ||
|
||
Copy-Item -Path "assets/archive/*" -Destination $stagingDir -Recurse | ||
New-Item -ItemType Directory -Path (Join-Path $stagingDir "engine/tools") | ||
Copy-Item -Path "target/release/scc.exe" -Destination (Join-Path $stagingDir "engine/tools/scc.exe") | ||
|
||
Compress-Archive -Path (Join-Path $stagingDir '*') -DestinationPath $zipPath | ||
|
||
Write-Output "Archive created at $zipPath" |