From 74138012ce4a2fa08e4cd73fcc6c065d08a4485e Mon Sep 17 00:00:00 2001 From: Liam Sho Date: Mon, 9 May 2022 14:04:11 +0800 Subject: [PATCH] =?UTF-8?q?ci.=E4=BF=AE=E6=94=B9=E4=BD=BF=E7=94=A8=20GitHu?= =?UTF-8?q?b=20Action=20=E7=9A=84=20Upload=20Artifacts=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maa-dev-build.yaml | 8 ++++++-- src/MeoAssistantBuilder/Tasks/DevBuildTask.cs | 17 ----------------- .../Tasks/ReleaseCoreTask.cs | 15 --------------- .../Tasks/ReleaseResourceTask.cs | 15 --------------- src/MeoAssistantBuilder/Tasks/ReleaseWpfTask.cs | 15 --------------- 5 files changed, 6 insertions(+), 64 deletions(-) diff --git a/.github/workflows/maa-dev-build.yaml b/.github/workflows/maa-dev-build.yaml index 057782f93a..63fb758d0d 100644 --- a/.github/workflows/maa-dev-build.yaml +++ b/.github/workflows/maa-dev-build.yaml @@ -20,5 +20,9 @@ jobs: - name: Run dev build task run: pwsh .\ci-dev-build.ps1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: Dev Build Bundles + path: ./artifacts diff --git a/src/MeoAssistantBuilder/Tasks/DevBuildTask.cs b/src/MeoAssistantBuilder/Tasks/DevBuildTask.cs index fd5ae6ea8a..0f8d93616b 100644 --- a/src/MeoAssistantBuilder/Tasks/DevBuildTask.cs +++ b/src/MeoAssistantBuilder/Tasks/DevBuildTask.cs @@ -57,22 +57,5 @@ public sealed class DevBuildTask : FrostingTask context.CopyThirdPartyDlls(releaseCiOutput); context.CopyResources(releaseCiOutput); ZipFile.CreateFromDirectory(releaseCiOutput, releaseCiArtifact); - - context.Information("--------------------------------------------------"); - context.Information("5. Upload Artifacts"); - context.Information("--------------------------------------------------"); - - var gh = context.GitHubActions(); - if (gh.IsRunningOnGitHubActions) - { - context.Information("Upload artifacts to GitHub Actions"); - gh.Commands.UploadArtifact(Cake.Core.IO.FilePath.FromString(releaseArtifact), artifact.Replace("(CONF)", "Release")).Wait(); - gh.Commands.UploadArtifact(Cake.Core.IO.FilePath.FromString(releaseDebugArtifact), artifact.Replace("(CONF)", "RelWithDebInfo")).Wait(); - gh.Commands.UploadArtifact(Cake.Core.IO.FilePath.FromString(releaseCiArtifact), artifact.Replace("(CONF)", "CICD")).Wait(); - } - else - { - context.Information("Skip"); - } } } diff --git a/src/MeoAssistantBuilder/Tasks/ReleaseCoreTask.cs b/src/MeoAssistantBuilder/Tasks/ReleaseCoreTask.cs index f2e39cb757..27d2f0df99 100644 --- a/src/MeoAssistantBuilder/Tasks/ReleaseCoreTask.cs +++ b/src/MeoAssistantBuilder/Tasks/ReleaseCoreTask.cs @@ -83,20 +83,5 @@ public sealed class ReleaseCoreTask : FrostingTask ZipFile.CreateFromDirectory(buildOutput, bundle); context.Information($"Bundled MAACore DLLs file: {bundle}"); - - context.Information("--------------------------------------------------"); - context.Information("6. Upload Artifact"); - context.Information("--------------------------------------------------"); - - var gh = context.GitHubActions(); - if (gh.IsRunningOnGitHubActions) - { - context.Information("Upload artifacts to GitHub Actions"); - gh.Commands.UploadArtifact(Cake.Core.IO.FilePath.FromString(bundle), $"MaaCore-{version}.zip").Wait(); - } - else - { - context.Information("Skip"); - } } } diff --git a/src/MeoAssistantBuilder/Tasks/ReleaseResourceTask.cs b/src/MeoAssistantBuilder/Tasks/ReleaseResourceTask.cs index e73b1cd893..de89df2d60 100644 --- a/src/MeoAssistantBuilder/Tasks/ReleaseResourceTask.cs +++ b/src/MeoAssistantBuilder/Tasks/ReleaseResourceTask.cs @@ -39,20 +39,5 @@ public sealed class ReleaseResourceTask : FrostingTask ZipFile.CreateFromDirectory(resDir, bundle); context.Information($"Bundled MaaResource file: {bundle}"); - - context.Information("--------------------------------------------------"); - context.Information("4. Upload Artifact"); - context.Information("--------------------------------------------------"); - - var gh = context.GitHubActions(); - if (gh.IsRunningOnGitHubActions) - { - context.Information("Upload artifacts to GitHub Actions"); - gh.Commands.UploadArtifact(Cake.Core.IO.FilePath.FromString(bundle), $"MaaResource-{version}.zip").Wait(); - } - else - { - context.Information("Skip"); - } } } diff --git a/src/MeoAssistantBuilder/Tasks/ReleaseWpfTask.cs b/src/MeoAssistantBuilder/Tasks/ReleaseWpfTask.cs index 681bc85f3a..43b7ceb0b9 100644 --- a/src/MeoAssistantBuilder/Tasks/ReleaseWpfTask.cs +++ b/src/MeoAssistantBuilder/Tasks/ReleaseWpfTask.cs @@ -42,20 +42,5 @@ public sealed class ReleaseWpfTask : FrostingTask ZipFile.CreateFromDirectory(buildOutput, bundle); context.Information($"Bundled MaaWpf Executables file: {bundle}"); - - context.Information("--------------------------------------------------"); - context.Information("5. Upload Artifact"); - context.Information("--------------------------------------------------"); - - var gh = context.GitHubActions(); - if (gh.IsRunningOnGitHubActions) - { - context.Information("Upload artifacts to GitHub Actions"); - gh.Commands.UploadArtifact(Cake.Core.IO.FilePath.FromString(bundle), $"MaaWpf-{version}.zip").Wait(); - } - else - { - context.Information("Skip"); - } } }