Skip to content

Commit

Permalink
update package reference and workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Scighost committed Jan 13, 2025
1 parent 1f34ca3 commit a8c20c8
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 22 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/publish_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,43 +52,49 @@ 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
Move-Item -Path ${{runner.temp}}/ossutil-v1.7.19-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 }}
- 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
needs: build

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

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@ 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
Move-Item -Path ${{runner.temp}}/ossutil-v1.7.19-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 }}
- 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 }}
Expand Down
4 changes: 2 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
$ErrorActionPreference = "Stop";

if ($Dev) {
dotnet publish src/Starward -c Release -r "win-$Architecture" -o "build/Starward/app-$Version" -p:Platform=$Architecture -p:DefineConstants=DEV -p:PublishReadyToRun=true -p:PublishTrimmed=true -p:TrimMode=partial -p:Version=$Version -p:UseRidGraph=true;
dotnet publish src/Starward -c Release -r "win-$Architecture" -o "build/Starward/app-$Version" -p:Platform=$Architecture -p:DefineConstants=DEV -p:PublishReadyToRun=true -p:PublishTrimmed=true -p:TrimMode=partial -p:Version=$Version;
}
else {
dotnet publish src/Starward -c Release -r "win-$Architecture" -o "build/Starward/app-$Version" -p:Platform=$Architecture -p:PublishReadyToRun=true -p:PublishTrimmed=true -p:TrimMode=partial -p:Version=$Version -p:UseRidGraph=true;
dotnet publish src/Starward -c Release -r "win-$Architecture" -o "build/Starward/app-$Version" -p:Platform=$Architecture -p:PublishReadyToRun=true -p:PublishTrimmed=true -p:TrimMode=partial -p:Version=$Version;
}

$env:Path += ';C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\';
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "9.0.100"
"version": "9.0.101"
}
}
6 changes: 5 additions & 1 deletion metadata.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,21 @@ $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";
}

$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;
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions src/Starward/Starward.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,28 @@
<CsWinRTAotOptimizerEnabled Condition="'$(Configuration)' == 'Debug'">false</CsWinRTAotOptimizerEnabled>
<CsWinRTAotOptimizerEnabled Condition="'$(Configuration)' != 'Debug'">true</CsWinRTAotOptimizerEnabled>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0-preview2" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="CommunityToolkit.WinUI.Animations" Version="8.1.240916" />
<PackageReference Include="CommunityToolkit.WinUI.Behaviors" Version="8.1.240916" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.1.240916" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.Segmented" Version="8.1.240916" />
<PackageReference Include="CommunityToolkit.WinUI.Helpers" Version="8.1.240916" />
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="H.NotifyIcon.WinUI" Version="2.1.4" />
<PackageReference Include="H.NotifyIcon.WinUI" Version="2.2.0" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="9.0.0" />
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.3.0" />
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.3.1" />
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.2.0" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.241114003" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
<PackageReference Include="MiniExcel" Version="1.35.0" />
<PackageReference Include="MiniExcel" Version="1.36.0" />
<PackageReference Include="NuGet.Versioning" Version="6.12.1" />
<PackageReference Include="Scighost.WinUI" Version="0.1.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="Starward.Assets" Version="0.4.17" />
<PackageReference Include="Starward.NativeLib" Version="0.2.1" />
Expand Down

0 comments on commit a8c20c8

Please sign in to comment.