Skip to content

Commit

Permalink
Merge pull request #2262 from DGP-Studio/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightczx authored Dec 4, 2024
2 parents 49664e8 + 07e595b commit 641bdde
Show file tree
Hide file tree
Showing 2,094 changed files with 5,833 additions and 3,842 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
workflow_dispatch:
push:
branches-ignore:
- develop
- l10n_develop
- main
- release
Expand All @@ -28,24 +27,38 @@ jobs:
fetch-depth: 0

- name: Merge all branches into develop locally
id: merge
run: |
$continue = $true
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git fetch origin '+refs/heads/*:refs/remotes/origin/*'
git checkout origin/develop
$response = curl -s https://api.github.com/repos/DGP-Studio/Snap.Hutao/pulls?state=open
$refs = $response | ConvertFrom-Json | Where-Object { $_.draft -eq $false } | ForEach-Object { $_.head.ref }
if ($refs.Count -eq 1 -and $refs -eq "l10n_develop") {
echo "No PRs to merge"
$continue = $false
echo "continue=$continue" >> $Env:GITHUB_OUTPUT
exit
}
foreach ($ref in $refs) {
echo "Merging $ref into develop"
git merge "origin/$ref" --strategy=ort --allow-unrelated-histories -m "Merge $ref into develop"
}
echo "continue=$continue" >> $Env:GITHUB_OUTPUT
- name: Setup .NET
if: ${{ steps.merge.outputs.continue == 'true' }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0

- name: Cache NuGet packages
if: ${{ steps.merge.outputs.continue == 'true' }}
uses: actions/cache@v4
with:
path: ~/.nuget/packages
Expand All @@ -54,6 +67,7 @@ jobs:
${{ runner.os }}-nuget-
- name: Cake
if: ${{ steps.merge.outputs.continue == 'true' }}
id: cake
shell: pwsh
run: dotnet tool restore && dotnet cake
Expand All @@ -62,14 +76,14 @@ jobs:
PW: ${{ secrets.PW }}

- name: Upload signed msix
if: success()
if: ${{ success() && steps.merge.outputs.continue == 'true' }}
uses: actions/upload-artifact@v4
with:
name: Snap.Hutao.Canary-${{ steps.cake.outputs.version }}
path: ${{ github.workspace }}/src/output/Snap.Hutao.Canary-${{ steps.cake.outputs.version }}.msix

- name: Add summary
if: success()
if: ${{ success() && steps.merge.outputs.continue == 'true' }}
shell: pwsh
run: |
$summary = "
Expand Down
17 changes: 17 additions & 0 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ Information($"Windows SDK: {winsdkPath}");
Task("Build")
.IsDependentOn("Build binary package")
.IsDependentOn("Copy files")
.IsDependentOn("Remove unused files")
.IsDependentOn("Build MSIX")
.IsDependentOn("Sign");

Expand Down Expand Up @@ -235,9 +236,25 @@ Task("Copy files")
);
});

Task("Remove unused files")
.IsDependentOn("Build binary package")
.Does(() =>
{
Information("Removing unused files...");

Information("Removing xbf...");
System.IO.Directory.Delete(System.IO.Path.Combine(binPath, "Service"), true);
System.IO.Directory.Delete(System.IO.Path.Combine(binPath, "UI"), true);
System.IO.File.Delete(System.IO.Path.Combine(binPath, "App.xbf"));

Information("Removing appxrecipe...");
System.IO.File.Delete(System.IO.Path.Combine(binPath, "Snap.Hutao.build.appxrecipe"));
});

Task("Build MSIX")
.IsDependentOn("Build binary package")
.IsDependentOn("Copy files")
.IsDependentOn("Remove unused files")
.Does(() =>
{
var arguments = "arguments";
Expand Down
Loading

0 comments on commit 641bdde

Please sign in to comment.