21 lines
727 B
YAML
21 lines
727 B
YAML
name: 'Cache NuGet Packages'
|
|
description: '快取 NUGET 套件'
|
|
inputs:
|
|
cache-arch:
|
|
description: '指定快取 NUGET 套件的架構,避免還原失敗'
|
|
outputs:
|
|
cache-hit:
|
|
description: '表示是否命中快取'
|
|
value: ${{ steps.cache.outputs.cache-hit }}
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Restore NuGet cache
|
|
id: cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.nuget/packages
|
|
key: ${{ inputs.cache-arch || runner.os }}-nuget-${{ hashFiles('NuGet.Config', '**/*.sln', '**/*.csproj', '**/global.json', '**/packages.lock.json', '**/Directory.Build.props', '**/Directory.Build.targets') }}
|
|
restore-keys: |
|
|
${{ inputs.cache-arch || runner.os }}-nuget-
|