From a1a5cbb16fd1d48ce6a62c8a166284d8bb2cc2ff Mon Sep 17 00:00:00 2001 From: routersys Date: Sat, 7 Nov 2026 22:08:55 +0900 Subject: [PATCH] =?UTF-8?q?Gitea=20Actions=20=E3=81=AE=E3=83=AF=E3=83=BC?= =?UTF-8?q?=E3=82=AF=E3=83=95=E3=83=AD=E3=83=BC=E3=82=92=E7=9B=B4=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/release.yml | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 09fff94..7e17d2b 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -21,23 +21,16 @@ jobs: - name: ソースコードのチェックアウト uses: actions/checkout@v7 env: - GIT_CONFIG_COUNT: "3" + GIT_CONFIG_COUNT: "2" GIT_CONFIG_KEY_0: url.https://git.routersys.com/routersys/.insteadOf GIT_CONFIG_VALUE_0: https://github.com/routersys/ - GIT_CONFIG_KEY_1: url.https://github.com/routersys/ComputeSharp.insteadOf - GIT_CONFIG_VALUE_1: https://github.com/routersys/ComputeSharp - GIT_CONFIG_KEY_2: url.https://git.routersys.com/manju-summoner/YukkuriMovieMaker.Generator.insteadOf - GIT_CONFIG_VALUE_2: https://github.com/manju-summoner/YukkuriMovieMaker.Generator + GIT_CONFIG_KEY_1: url.https://git.routersys.com/manju-summoner/YukkuriMovieMaker.Generator.insteadOf + GIT_CONFIG_VALUE_1: https://github.com/manju-summoner/YukkuriMovieMaker.Generator with: ref: ${{ inputs.tag || github.ref_name }} submodules: recursive fetch-depth: 0 - - name: .NET SDK のセットアップ - uses: actions/setup-dotnet@v6 - with: - dotnet-version: '10.0.x' - - name: MSBuild のセットアップ uses: microsoft/setup-msbuild@v3 @@ -52,9 +45,26 @@ jobs: $asset = $release.assets | Where-Object { $_.name -like "*.zip" } | Select-Object -First 1 } Write-Host "ダウンロード対象: $($asset.name)" - Invoke-WebRequest -Uri $asset.browser_download_url -OutFile "ymm4.zip" - Expand-Archive -Path "ymm4.zip" -DestinationPath "ymm4_extracted" -Force - $ymm4Dir = (Get-ChildItem -Path "ymm4_extracted" -Recurse -Filter "YukkuriMovieMaker.dll" | + $cache = Join-Path 'C:\runner\cache\ymm4' $asset.name + $extracted = "$cache.extracted" + $lock = New-Object System.Threading.Mutex($false, 'Global\ci-ymm4-cache') + [void]$lock.WaitOne() + try { + if (-not (Test-Path "$extracted\.complete")) { + New-Item -ItemType Directory -Force -Path (Split-Path $cache) | Out-Null + Invoke-WebRequest -Uri $asset.browser_download_url -OutFile $cache + Remove-Item -Recurse -Force $extracted -ErrorAction SilentlyContinue + Expand-Archive -Path $cache -DestinationPath $extracted -Force + New-Item -ItemType File -Path "$extracted\.complete" | Out-Null + } + else { + Write-Host "保存済みの YMM4 を使います: $extracted" + } + } + finally { + $lock.ReleaseMutex() + } + $ymm4Dir = (Get-ChildItem -Path $extracted -Recurse -Filter "YukkuriMovieMaker.dll" | Select-Object -First 1).DirectoryName Write-Host "YMM4 DLL ディレクトリ: $ymm4Dir" echo "YMM4_DIR=$ymm4Dir\" >> $env:GITHUB_OUTPUT