From a7c4b8f3560b84e78459a34bc3c73735982d802d Mon Sep 17 00:00:00 2001 From: azyges Date: Mon, 6 Oct 2025 04:02:01 +0900 Subject: [PATCH] clean --- .../workflows/lightless-tag-and-release.yml | 140 ------------------ .../WebAPI/Files/FileDownloadManager.cs | 4 +- 2 files changed, 1 insertion(+), 143 deletions(-) delete mode 100644 .github/workflows/lightless-tag-and-release.yml diff --git a/.github/workflows/lightless-tag-and-release.yml b/.github/workflows/lightless-tag-and-release.yml deleted file mode 100644 index 9391829..0000000 --- a/.github/workflows/lightless-tag-and-release.yml +++ /dev/null @@ -1,140 +0,0 @@ -name: Tag and Release Lightless - -on: - push: - branches: [ master ] - -env: - PLUGIN_NAME: LightlessSync - DOTNET_VERSION: 9.x - -jobs: - tag-and-release: - runs-on: windows-2022 - permissions: - contents: write - - steps: - - name: Checkout Lightless - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: true - - - name: Setup .NET 9 SDK - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 9.x - - - name: Download Dalamud - run: | - Invoke-WebRequest -Uri https://goatcorp.github.io/dalamud-distrib/stg/latest.zip -OutFile latest.zip - Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev" - - - name: Lets Build Lightless! - run: | - dotnet restore - dotnet build --configuration Release --no-restore - dotnet publish --configuration Release --no-build - - - name: Get version - id: package_version - uses: KageKirin/get-csproj-version@v0 - with: - file: LightlessSync/LightlessSync.csproj - - - name: Display version - run: | - echo "Version: ${{ steps.package_version.outputs.version }}" - - - name: Prepare Lightless Client - run: | - $publishPath = "${{ env.PLUGIN_NAME }}/bin/x64/Release/publish" - if (Test-Path $publishPath) { - Remove-Item -Recurse -Force $publishPath - Write-Host "Removed $publishPath" - } else { - Write-Host "$publishPath does not exist, nothing to remove." - } - mkdir output - Compress-Archive -Path ${{ env.PLUGIN_NAME }}/bin/x64/Release/* -DestinationPath output/LightlessClient.zip - - - name: Create Git tag if not exists - shell: pwsh - run: | - $tag = "${{ steps.package_version.outputs.version }}" - git fetch --tags - if (-not (git tag -l $tag)) { - Write-Host "Tag $tag does not exist. Creating and pushing..." - git config user.name "GitHub Action" - git config user.email "action@github.com" - git tag $tag - git push origin $tag - } else { - Write-Host "Tag $tag already exists. Skipping tag creation." - } - - - name: Create GitHub Release - uses: softprops/action-gh-release@v2 - with: - tag_name: ${{ steps.package_version.outputs.version }} - name: ${{ steps.package_version.outputs.version }} - draft: false - prerelease: false - files: output/LightlessClient.zip - - - name: Clone plugin hosting repo - run: | - mkdir LightlessSyncRepo - cd LightlessSyncRepo - git clone https://github.com/${{ github.repository_owner }}/LightlessSync.git - env: - GIT_TERMINAL_PROMPT: 0 - - - name: Update plogonmaster.json with version - shell: pwsh - env: - VERSION: ${{ steps.package_version.outputs.version }} - run: | - $pluginJsonPath = "${{ env.PLUGIN_NAME }}/bin/x64/Release/${{ env.PLUGIN_NAME }}.json" - $pluginJson = Get-Content $pluginJsonPath | ConvertFrom-Json - $repoJsonPath = "LightlessSyncRepo/LightlessSync/plogonmaster.json" - $repoJsonRaw = Get-Content $repoJsonPath -Raw - $repoJson = $repoJsonRaw | ConvertFrom-Json - $version = $env:VERSION - $downloadUrl = "https://github.com/${{ github.repository_owner }}/LightlessClient/releases/download/$version/LightlessClient.zip" - - if (-not ($repoJson -is [System.Collections.IEnumerable])) { - $repoJson = @($repoJson) - } - - foreach ($plugin in $repoJson) { - if ($plugin.InternalName -eq $pluginJson.InternalName) { - $plugin.DalamudApiLevel = $pluginJson.DalamudApiLevel - $plugin.AssemblyVersion = $version - $plugin.DownloadLinkInstall = $downloadUrl - $plugin.DownloadLinkTesting = $downloadUrl - $plugin.DownloadLinkUpdate = $downloadUrl - } - } - - $repoJson | ConvertTo-Json -Depth 100 | Set-Content $repoJsonPath - - # Convert to JSON and force array brackets if necessary - $repoJsonString = $repoJson | ConvertTo-Json -Depth 100 - - # If the output is not an array, wrap it manually - if ($repoJsonString.Trim().StartsWith('{')) { - $repoJsonString = "[$repoJsonString]" - } - - $repoJsonString | Set-Content $repoJsonPath - - - name: Commit and push to LightlessSync - run: | - cd LightlessSyncRepo/LightlessSync - git config user.name "github-actions" - git config user.email "github-actions@github.com" - git add . - git commit -m "Update ${{ env.PLUGIN_NAME }} to ${{ steps.package_version.outputs.version }}" - git push https://x-access-token:${{ secrets.LIGHTLESS_TOKEN }}@github.com/${{ github.repository_owner }}/LightlessSync.git HEAD:main diff --git a/LightlessSync/WebAPI/Files/FileDownloadManager.cs b/LightlessSync/WebAPI/Files/FileDownloadManager.cs index 9248d50..3f48af2 100644 --- a/LightlessSync/WebAPI/Files/FileDownloadManager.cs +++ b/LightlessSync/WebAPI/Files/FileDownloadManager.cs @@ -554,6 +554,4 @@ public partial class FileDownloadManager : DisposableMediatorSubscriberBase _orchestrator.ClearDownloadRequest(requestId); } } -} - - +} \ No newline at end of file