Skip to content

ci: Add build caching #22

ci: Add build caching

ci: Add build caching #22

Workflow file for this run

name: windows
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: windows-latest
name: x64
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Setup cargo cache
uses: actions/cache@v3
with:
path: |
$HOME/.cargo/bin/
$HOME/.cargo/registry/index/
$HOME/.cargo/registry/cache/
$HOME/.cargo/git/db/
key: ${{ runner.os }}-cargo
- name: Setup target build cache
uses: actions/cache@v3
with:
path: target/
key: ${{ runner.os }}-cargo-target
- name: Cargo release build
run: cargo build --release --all-features --all --examples
- name: Create dist archive
run: |
New-Item -Force -ItemType Directory $env:TEMP/dist
New-Item -Force -ItemType Directory $env:TEMP/dist/tools
New-Item -Force -ItemType Directory $env:TEMP/dist/mkplugins
New-Item -Force -ItemType Directory $env:TEMP/dist/mods
Copy-Item -Force target/release/dinput8.dll $env:TEMP/dist
Copy-Item -Force target/release/makaikit_modloader_d7.dll $env:TEMP/dist/mkplugins
Copy-Item -Force target/release/examples/fafullfs-unpack.exe $env:TEMP/dist/tools
Copy-Item -Force target/release/examples/d7db-unpack.exe $env:TEMP/dist/tools
Compress-Archive -LiteralPath $env:TEMP/dist -DestinationPath $env:TEMP/makaikit-$env:GITHUB_REF_NAME.zip
Remove-Item -Recurse $env:TEMP/dist
- name: Artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: $env:TEMP/makaikit-${{ github.ref_name }}.zip
retention-days: 7