From ec89184cac2d909ae5c33aeab4cb61aefba108ce Mon Sep 17 00:00:00 2001 From: Scighost Date: Mon, 13 Jan 2025 23:13:43 +0800 Subject: [PATCH] update package reference and workflows --- .github/workflows/publish_dev.yml | 20 +++++++++++++------- .github/workflows/publish_preview.yml | 6 +++--- global.json | 2 +- metadata.ps1 | 6 +++++- src/Starward/Starward.csproj | 12 ++++++------ 5 files changed, 28 insertions(+), 18 deletions(-) diff --git a/.github/workflows/publish_dev.yml b/.github/workflows/publish_dev.yml index 235902883..80a3db5af 100644 --- a/.github/workflows/publish_dev.yml +++ b/.github/workflows/publish_dev.yml @@ -52,12 +52,12 @@ jobs: - name: Build run: ./build.ps1 -Architecture $env:Platform -Version $env:Version -Dev - - name: Metadata + - name: Create Metadata run: ./metadata.ps1 -Architecture $env:Platform -Version $env:Version -Dev - name: Setup OssUtil run: | - Invoke-WebRequest https://gosspublic.alicdn.com/ossutil/1.7.15/ossutil-v1.7.15-windows-amd64.zip -OutFile ${{runner.temp}}/ossutil.zip + Invoke-WebRequest https://gosspublic.alicdn.com/ossutil/1.7.19/ossutil-v1.7.19-windows-amd64.zip -OutFile ${{runner.temp}}/ossutil.zip Expand-Archive -Path ${{runner.temp}}/ossutil.zip -DestinationPath ${{runner.temp}} Move-Item -Path ${{runner.temp}}/ossutil-v1.7.15-windows-amd64/ossutil64.exe -Destination C:/Windows/System32/ossutil.exe -Force ossutil config -e ${{ secrets.OSS_ENDPOINT }} -i ${{ secrets.ACCESS_KEY_ID }} -k ${{ secrets.ACCESS_KEY_SECRET }} @@ -65,12 +65,18 @@ jobs: - name: Upload to OSS run: ossutil cp -rf ./build/release/ oss://starward/release/ --meta Content-Type:multipart/mixed - - name: Upload Artifact - uses: actions/upload-artifact@v3.1.2 + - name: Upload Metadata + uses: actions/upload-artifact@v4 with: name: metadata_${{ matrix.platform }} path: build/metadata/ + - name: Upload Release + uses: actions/upload-artifact@v4 + with: + name: Starward_Portable_${{ needs.version.outputs.version }}_${{ matrix.platform }} + path: build/release/package/dev/Starward_Portable_${{ needs.version.outputs.version }}_${{ matrix.platform }}.7z + metadata: runs-on: ubuntu-latest @@ -78,17 +84,17 @@ jobs: steps: - name: Checkout Metadata - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: metadata - name: Download Artifact x64 - uses: actions/download-artifact@v3.0.2 + uses: actions/download-artifact@v4 with: name: metadata_x64 - name: Download Artifact arm64 - uses: actions/download-artifact@v3.0.2 + uses: actions/download-artifact@v4 with: name: metadata_arm64 diff --git a/.github/workflows/publish_preview.yml b/.github/workflows/publish_preview.yml index 80eec7393..e88ccfe8e 100644 --- a/.github/workflows/publish_preview.yml +++ b/.github/workflows/publish_preview.yml @@ -49,12 +49,12 @@ jobs: - name: Build run: ./build.ps1 -Architecture $env:Platform -Version $env:Version - - name: Metadata + - name: Create Metadata run: ./metadata.ps1 -Architecture $env:Platform -Version $env:Version - name: Setup OssUtil run: | - Invoke-WebRequest https://gosspublic.alicdn.com/ossutil/1.7.15/ossutil-v1.7.15-windows-amd64.zip -OutFile ${{runner.temp}}/ossutil.zip + Invoke-WebRequest https://gosspublic.alicdn.com/ossutil/1.7.19/ossutil-v1.7.19-windows-amd64.zip -OutFile ${{runner.temp}}/ossutil.zip Expand-Archive -Path ${{runner.temp}}/ossutil.zip -DestinationPath ${{runner.temp}} Move-Item -Path ${{runner.temp}}/ossutil-v1.7.15-windows-amd64/ossutil64.exe -Destination C:/Windows/System32/ossutil.exe -Force ossutil config -e ${{ secrets.OSS_ENDPOINT }} -i ${{ secrets.ACCESS_KEY_ID }} -k ${{ secrets.ACCESS_KEY_SECRET }} @@ -62,7 +62,7 @@ jobs: - name: Upload to OSS run: ossutil cp -rf ./build/release/ oss://starward/release/ --meta Content-Type:multipart/mixed - - name: Upload Artifact + - name: Upload Metadata uses: actions/upload-artifact@v4 with: name: metadata_${{ matrix.platform }} diff --git a/global.json b/global.json index 686e09062..7e8c02767 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "8.0.402" + "version": "8.0.404" } } \ No newline at end of file diff --git a/metadata.ps1 b/metadata.ps1 index b3ebd90ac..f00f24647 100644 --- a/metadata.ps1 +++ b/metadata.ps1 @@ -10,11 +10,13 @@ $build = "build"; $starward = "$build/Starward"; if ($Dev) { $metadata = "$build/metadata/dev"; + $history = "$build/metadata/dev/history"; $package = "$build/release/package/dev"; $separate = "$build/release/separate_files/dev"; } else { $metadata = "$build/metadata/v1"; + $history = "$build/metadata/v1/history"; $package = "$build/release/package"; $separate = "$build/release/separate_files"; } @@ -22,6 +24,7 @@ else { $null = New-Item -Path $package -ItemType Directory -Force; $null = New-Item -Path $separate -ItemType Directory -Force; $null = New-Item -Path $metadata -ItemType Directory -Force; +$null = New-Item -Path $history -ItemType Directory -Force; if (!(Get-Module -Name 7Zip4Powershell -ListAvailable)) { Install-Module -Name 7Zip4Powershell -Force; @@ -34,7 +37,7 @@ if (!(Test-Path $portableFile)) { Compress-7Zip -ArchiveFileName $portableName -Path $starward -OutputPath $package -CompressionLevel Ultra -PreserveDirectoryRoot; } -$release = @{ +$release = [ordered]@{ Version = $Version Architecture = $Architecture BuildTime = Get-Date @@ -62,6 +65,7 @@ $hash = @{l = "Hash"; e = { (Get-FileHash $_).Hash } }; $release.SeparateFiles = Get-ChildItem -Path $starward -File -Recurse | Select-Object -Property $path, $size, $hash; Out-File -Path "$metadata/release_preview_$Architecture.json" -InputObject (ConvertTo-Json $release); +Copy-Item -Path "$metadata/release_preview_$Architecture.json" -Destination "$history/release_$($Version)_$Architecture.json" -Force; foreach ($file in $release.SeparateFiles) { Move-Item -Path "$starward/$($file.Path)" -Destination "$separate/$($file.Hash)" -Force; diff --git a/src/Starward/Starward.csproj b/src/Starward/Starward.csproj index 322e6321b..9677631b0 100644 --- a/src/Starward/Starward.csproj +++ b/src/Starward/Starward.csproj @@ -23,22 +23,22 @@ - + - - + + - + - - + +